forked from M-Labs/nac3
fixup! artiq: reimplement get_obj_value to use ndarray with strides
update symbol_resolver for general array
This commit is contained in:
parent
8b0305ab6b
commit
ac6c7c5985
@ -1149,7 +1149,7 @@ impl InnerResolver {
|
||||
|
||||
// create a global for ndarray.shape and initialize it using the shape
|
||||
let shape_global = ctx.module.add_global(
|
||||
Array { len: ndims as u32, item: Int(SizeT) }.get_type(generator, ctx.ctx),
|
||||
Array { len: AnyLen(ndims as u32), item: Int(SizeT) }.get_type(generator, ctx.ctx),
|
||||
Some(AddressSpace::default()),
|
||||
&(id_str.clone() + ".shape"),
|
||||
);
|
||||
@ -1181,7 +1181,7 @@ impl InnerResolver {
|
||||
// NOTE: NDArray's `data` is `u8*`. Here, `data_global` is an array of `dtype`.
|
||||
// We will have to cast it to an `u8*` later.
|
||||
let data_global = ctx.module.add_global(
|
||||
Array { len: sz as u32, item: dtype }.get_type(generator, ctx.ctx),
|
||||
Array { len: AnyLen(sz as u32), item: dtype }.get_type(generator, ctx.ctx),
|
||||
Some(AddressSpace::default()),
|
||||
&(id_str.clone() + ".data"),
|
||||
);
|
||||
@ -1201,7 +1201,7 @@ impl InnerResolver {
|
||||
|
||||
// create a global for ndarray.strides and initialize it
|
||||
let strides_global = ctx.module.add_global(
|
||||
Array { len: ndims as u32, item: Int(Byte) }.get_type(generator, ctx.ctx),
|
||||
Array { len: AnyLen(ndims as u32), item: Int(Byte) }.get_type(generator, ctx.ctx),
|
||||
Some(AddressSpace::default()),
|
||||
&(id_str.clone() + ".strides"),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user