MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / async_copy_from

Method async_copy_from

crates/cust/src/memory/device/device_box.rs:468–480  ·  view source on GitHub ↗
(&mut self, val: &T, stream: &Stream)

Source from the content-addressed store, hash-verified

466}
467impl<T: DeviceCopy> AsyncCopyDestination<T> for DeviceBox<T> {
468 unsafe fn async_copy_from(&mut self, val: &T, stream: &Stream) -> CudaResult<()> {
469 let size = mem::size_of::<T>();
470 if size != 0 {
471 cuda::cuMemcpyHtoDAsync_v2(
472 self.ptr.as_raw(),
473 val as *const _ as *const c_void,
474 size,
475 stream.as_inner(),
476 )
477 .to_result()?
478 }
479 Ok(())
480 }
481
482 unsafe fn async_copy_to(&self, val: &mut T, stream: &Stream) -> CudaResult<()> {
483 let size = mem::size_of::<T>();

Callers 4

new_asyncMethod · 0.45
from_slice_asyncMethod · 0.45

Calls 3

to_resultMethod · 0.45
as_rawMethod · 0.45
as_innerMethod · 0.45