Fix more bugs

This commit is contained in:
Andrzej Janik 2021-06-27 11:46:59 +02:00
parent 015d23b5ad
commit b2765370e5
3 changed files with 5 additions and 1 deletions

View file

@ -153,6 +153,7 @@ pub fn launch_kernel(
&mut [],
)?;
}
cmd_list.close()?;
stream.queue.execute_and_synchronize(cmd_list)?;
Ok(())
})?

View file

@ -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>(())
})?

View file

@ -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 {