pub fn register<T: Copy>(
ptr: *mut T,
len: usize,
flags: RegisterFlags,
) -> CudaResult<RegisteredMemory<T>>Expand description
Registers an existing host memory range with the CUDA driver for DMA.
§Safety contract (upheld by the caller)
ptrmust point to a valid allocation of at leastlen * size_of::<T>()bytes.- The allocation must remain valid for the lifetime of the returned handle.
§Errors
CudaError::InvalidValueiflenis zero or the byte size overflows.CudaError::NotSupportedon macOS.- Other driver errors from
cuMemHostRegister_v2.