Skip to content

Commit 4e9cced

Browse files
Merge pull request #48 from windwhiterain/main
update LuisaCompute to latest commit, fix missing alignment arg
2 parents bee7890 + 06ed283 commit 4e9cced

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

luisa_compute/src/runtime.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,8 +1296,8 @@ impl KernelArgEncoder {
12961296
}
12971297
}
12981298
pub fn uniform<T: Value>(&mut self, value: T) {
1299+
let layout = std::alloc::Layout::new::<T>();
12991300
let mut data_u8 = unsafe {
1300-
let layout = std::alloc::Layout::new::<T>();
13011301
let ptr = std::alloc::alloc(layout);
13021302
let slice = std::slice::from_raw_parts_mut(ptr as *mut u8, layout.size());
13031303
Box::from_raw(slice)
@@ -1312,6 +1312,7 @@ impl KernelArgEncoder {
13121312
self.args.push(api::Argument::Uniform(api::UniformArgument {
13131313
data: data_u8.as_ptr(),
13141314
size: data_u8.len(),
1315+
alignment: layout.align(),
13151316
}));
13161317
self.uniform_data.push(data_u8);
13171318
}

luisa_compute_sys/LuisaCompute

Submodule LuisaCompute updated 1415 files

0 commit comments

Comments
 (0)