Skip to main content

register

Function register 

Source
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)

  • ptr must point to a valid allocation of at least len * size_of::<T>() bytes.
  • The allocation must remain valid for the lifetime of the returned handle.

§Errors