From fd85608d1c1e0a154a8f99d30b996e1bca88326c Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 15 Aug 2024 15:17:21 +0800 Subject: [PATCH] [artiq] WIP --- nac3artiq/src/codegen.rs | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/nac3artiq/src/codegen.rs b/nac3artiq/src/codegen.rs index 05cbe455..76cbb66c 100644 --- a/nac3artiq/src/codegen.rs +++ b/nac3artiq/src/codegen.rs @@ -662,17 +662,17 @@ fn format_rpc_ret<'ctx>( }, |generator, ctx| { let phi = phi.as_basic_value().into_pointer_value(); - let pbuffer_data_begin = unsafe { - ctx.builder.build_in_bounds_gep(phi, &[llvm_usize.const_int(0, false)], "") - } - .unwrap(); - call_memcpy_generic( - ctx, - ndarray.ptr_to_data(ctx), - pbuffer_data_begin, - llvm_pdata_sizeof, - llvm_i1.const_zero(), - ); + // let pbuffer_data_begin = unsafe { + // ctx.builder.build_in_bounds_gep(phi, &[llvm_usize.const_int(0, false)], "") + // } + // .unwrap(); + // call_memcpy_generic( + // ctx, + // ndarray.ptr_to_data(ctx), + // pbuffer_data_begin, + // llvm_pdata_sizeof, + // llvm_i1.const_zero(), + // ); let pbuffer_dims_begin = unsafe { ctx.builder.build_in_bounds_gep(phi, &[llvm_pdata_sizeof], "") } @@ -685,20 +685,20 @@ fn format_rpc_ret<'ctx>( llvm_i1.const_zero(), ); - // // TODO: Testing for buffer - // ndarray.create_data( - // ctx, - // llvm_elem_ty, - // call_ndarray_calc_size(generator, ctx, &ndarray.dim_sizes(), (None, None)), - // ); - // - // call_memcpy_generic( - // ctx, - // ndarray.data().base_ptr(ctx, generator), - // buffer.base_ptr(ctx, generator), - // llvm_usize.const_int(12, false), - // llvm_i1.const_zero(), - // ); + // TODO: Testing for buffer + ndarray.create_data( + ctx, + llvm_elem_ty, + call_ndarray_calc_size(generator, ctx, &ndarray.dim_sizes(), (None, None)), + ); + + call_memcpy_generic( + ctx, + ndarray.data().base_ptr(ctx, generator), + buffer.base_ptr(ctx, generator), + llvm_usize.const_int(12, false), + llvm_i1.const_zero(), + ); Ok(()) },