WIP - [artiq] Invert parse order

This commit is contained in:
David Mak 2024-08-15 03:16:10 +08:00
parent 0c18154d15
commit 2c2f3e4da4
1 changed files with 36 additions and 12 deletions

View File

@ -641,30 +641,54 @@ fn format_rpc_ret<'ctx>(
.unwrap())
},
|generator, ctx| {
// let ppdata =
// generator.gen_var_alloc(ctx, llvm_ret_ty.element_type(), None).unwrap();
// ctx.builder
// .build_store(ppdata, ndarray.data().base_ptr(ctx, generator))
// .unwrap();
// call_memcpy_generic(
// ctx,
// ppdata,
// buffer.base_ptr(ctx, generator),
// llvm_pdata_sizeof,
// llvm_i1.const_zero(),
// );
//
// let pbuffer_dims_begin = unsafe {
// buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None)
// };
// call_memcpy_generic(
// ctx,
// ndarray.dim_sizes().base_ptr(ctx, generator),
// pbuffer_dims_begin,
// dims_buf_sz,
// llvm_i1.const_zero(),
// );
call_memcpy_generic(
ctx,
ndarray.dim_sizes().base_ptr(ctx, generator),
buffer.base_ptr(ctx, generator),
dims_buf_sz,
llvm_i1.const_zero(),
);
let ppdata =
generator.gen_var_alloc(ctx, llvm_ret_ty.element_type(), None).unwrap();
let pbuffer_data_begin = unsafe {
buffer.ptr_offset_unchecked(ctx, generator, &dims_buf_sz, None)
};
ctx.builder
.build_store(ppdata, ndarray.data().base_ptr(ctx, generator))
.unwrap();
call_memcpy_generic(
ctx,
ppdata,
buffer.base_ptr(ctx, generator),
pbuffer_data_begin,
llvm_pdata_sizeof,
llvm_i1.const_zero(),
);
let pbuffer_dims_begin = unsafe {
buffer.ptr_offset_unchecked(ctx, generator, &llvm_pdata_sizeof, None)
};
call_memcpy_generic(
ctx,
ndarray.dim_sizes().base_ptr(ctx, generator),
pbuffer_dims_begin,
dims_buf_sz,
llvm_i1.const_zero(),
);
Ok(())
},
|_, _| Ok(()),