Skip to main content

memcpy_host_to_device

Function memcpy_host_to_device 

Source
pub unsafe fn memcpy_host_to_device(
    device: *mut c_void,
    host: *const c_void,
    count: usize,
) -> bool
Expand description

Copy count bytes from host to a CUDA device pointer. Returns false on failure or if libcudart is unavailable.

The counterpart of memcpy_device_to_host, for filling a writable mapping (CudaHandle::map_mut) from host bytes.

ยงSafety

The caller must ensure:

  • host points to at least count bytes of readable memory.
  • device points to at least count bytes of valid CUDA device memory (i.e. obtained from a CudaMap::device_ptr() while the map is live).