diff --git a/zluda/src/impl/function.rs b/zluda/src/impl/function.rs index bcb7bd6..4f2006c 100644 --- a/zluda/src/impl/function.rs +++ b/zluda/src/impl/function.rs @@ -153,6 +153,7 @@ pub fn launch_kernel( &mut [], )?; } + cmd_list.close()?; stream.queue.execute_and_synchronize(cmd_list)?; Ok(()) })? diff --git a/zluda/src/impl/memory.rs b/zluda/src/impl/memory.rs index 2a6236f..238d68e 100644 --- a/zluda/src/impl/memory.rs +++ b/zluda/src/impl/memory.rs @@ -14,6 +14,7 @@ pub fn copy_v2(dst: *mut c_void, src: *const c_void, bytesize: usize) -> Result< GlobalState::lock_stream(stream::CU_STREAM_LEGACY, |stream| { let cmd_list = stream.command_list()?; unsafe { cmd_list.append_memory_copy_raw(dst, src, bytesize, None, &mut [])? }; + cmd_list.close()?; stream.queue.execute_and_synchronize(cmd_list)?; Ok::<_, CUresult>(()) })? @@ -40,6 +41,7 @@ pub(crate) fn set_d32_v2(dst: *mut c_void, mut ui: u32, n: usize) -> Result<(), &mut [], ) }?; + cmd_list.close()?; stream.queue.execute_and_synchronize(cmd_list)?; Ok::<_, CUresult>(()) })? @@ -58,6 +60,7 @@ pub(crate) fn set_d8_v2(dst: *mut c_void, mut uc: u8, n: usize) -> Result<(), CU &mut [], ) }?; + cmd_list.close()?; stream.queue.execute_and_synchronize(cmd_list)?; Ok::<_, CUresult>(()) })? diff --git a/zluda/src/impl/os_unix.rs b/zluda/src/impl/os_unix.rs index dfbf305..bf3abcf 100644 --- a/zluda/src/impl/os_unix.rs +++ b/zluda/src/impl/os_unix.rs @@ -2,7 +2,7 @@ use std::ffi::c_void; use std::ptr; pub unsafe fn heap_create() -> *mut c_void { - ptr::null_mut() + usize::MAX as *mut _ } pub unsafe fn heap_alloc(heap: *mut c_void, bytes: usize) -> *mut c_void {