WIP - [artiq] Test
This commit is contained in:
parent
7ba1560442
commit
aaffe3cf9e
|
@ -605,7 +605,7 @@ fn format_rpc_ret<'ctx>(
|
|||
|
||||
// let buffer_size =
|
||||
// ctx.builder.build_int_add(dims_buf_sz, llvm_pdata_sizeof, "").unwrap();
|
||||
let buffer_size = llvm_usize.const_int(32, false);
|
||||
let buffer_size = llvm_usize.const_int(8, false);
|
||||
// let buffer_size = ctx.builder.build_left_shift(
|
||||
// ctx.builder.build_int_add(
|
||||
// ctx.builder.build_right_shift(
|
||||
|
@ -678,7 +678,7 @@ fn format_rpc_ret<'ctx>(
|
|||
ctx,
|
||||
generator,
|
||||
&llvm_usize.const_zero(),
|
||||
llvm_usize.const_int(9, false),
|
||||
llvm_usize.const_int(6, false),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -693,24 +693,42 @@ fn format_rpc_ret<'ctx>(
|
|||
// llvm_i1.const_zero(),
|
||||
// );
|
||||
|
||||
let sz = call_ndarray_calc_size(generator, ctx, &ndarray.dim_sizes(), (None, None));
|
||||
|
||||
ndarray.create_data(
|
||||
ctx,
|
||||
llvm_elem_ty,
|
||||
call_ndarray_calc_size(generator, ctx, &ndarray.dim_sizes(), (None, None)),
|
||||
sz,
|
||||
);
|
||||
|
||||
let sz_addr = ctx.builder.build_alloca(llvm_usize, "").unwrap();
|
||||
ctx.builder.build_store(sz_addr, sz).unwrap();
|
||||
let ndarray_pdata = unsafe {
|
||||
ndarray.data().base_ptr(ctx, generator)
|
||||
};
|
||||
call_memcpy_generic(
|
||||
ctx,
|
||||
ndarray_pdata,
|
||||
sz_addr,
|
||||
llvm_usize_sizeof,
|
||||
llvm_i1.const_zero(),
|
||||
);
|
||||
|
||||
let alloc_size_addr = ctx.builder.build_alloca(llvm_usize, "").unwrap();
|
||||
ctx.builder.build_store(alloc_size_addr, alloc_size).unwrap();
|
||||
let ndarray_pdata = unsafe {
|
||||
ndarray.data().ptr_offset_unchecked(ctx, generator, &llvm_usize.const_int(1, false), None)
|
||||
};
|
||||
call_memcpy_generic(
|
||||
ctx,
|
||||
ndarray.data().base_ptr(ctx, generator),
|
||||
ndarray_pdata,
|
||||
alloc_size_addr,
|
||||
llvm_usize_sizeof,
|
||||
llvm_i1.const_zero(),
|
||||
);
|
||||
|
||||
let ndarray_pdata = unsafe {
|
||||
ndarray.data().ptr_offset_unchecked(ctx, generator, &llvm_usize.const_int(1, false), None)
|
||||
ndarray.data().ptr_offset_unchecked(ctx, generator, &llvm_usize.const_int(2, false), None)
|
||||
};
|
||||
call_memcpy_generic(
|
||||
ctx,
|
||||
|
|
Loading…
Reference in New Issue