From ac6c7c598510ab6e3564f62d452c4477cb3a2073 Mon Sep 17 00:00:00 2001 From: lyken Date: Thu, 22 Aug 2024 20:57:56 +0800 Subject: [PATCH] fixup! artiq: reimplement get_obj_value to use ndarray with strides update symbol_resolver for general array --- nac3artiq/src/symbol_resolver.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nac3artiq/src/symbol_resolver.rs b/nac3artiq/src/symbol_resolver.rs index 53e244a9..edffb7e0 100644 --- a/nac3artiq/src/symbol_resolver.rs +++ b/nac3artiq/src/symbol_resolver.rs @@ -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"), );