forked from M-Labs/nac3
1
0
Fork 0

core/ndstrides: fix alloca_ndarray comment

This commit is contained in:
lyken 2024-07-30 15:09:14 +08:00
parent ac7cc15d90
commit 7e056b9747
1 changed files with 10 additions and 12 deletions

View File

@ -17,18 +17,16 @@ use crate::{
typecheck::typedef::{Type, TypeEnum},
};
/**
Allocate an ndarray on the stack given its `ndims`.
`shape` and `strides` will be automatically allocated on the stack.
The returned ndarray's content will be:
- `data`: `nullptr`
- `itemsize`: **uninitialized** value
- `ndims`: initialized value, set to the input `ndims`
- `shape`: initialized pointer to an allocated stack with **uninitialized** values
- `strides`: initialized pointer to an allocated stack with **uninitialized** values
*/
/// Allocate an ndarray on the stack given its `ndims`.
///
/// `shape` and `strides` will be automatically allocated on the stack.
///
/// The returned ndarray's content will be:
/// - `data`: `nullptr`
/// - `itemsize`: **uninitialized** value
/// - `ndims`: initialized value, set to the input `ndims`
/// - `shape`: initialized pointer to an allocated stack with **uninitialized** values
/// - `strides`: initialized pointer to an allocated stack with **uninitialized** values
pub fn alloca_ndarray<'ctx, G>(
generator: &mut G,
ctx: &mut CodeGenContext<'ctx, '_>,