Skip to main content

memcpy_batch

Function memcpy_batch 

Source
pub unsafe fn memcpy_batch(
    src_ptrs: *const *const c_void,
    dst_ptrs: *const *mut c_void,
    size_per_copy: usize,
    num_copies: usize,
    mode: MemcpyBatchMode,
    stream: cudaStream_t,
) -> cudaError_t
Expand description

Batched memcpy using cudaMemcpyBatchAsync (CUDA 12.9+) and/or individual cudaMemcpyAsync.

Takes HOST arrays of src/dst pointers - no device allocation needed. Direction is auto-determined by CUDA from pointer types using cudaMemcpyDefault.

The mode parameter controls dispatch:

ยงSafety

  • src_ptrs must point to a valid array of num_copies source pointers
  • dst_ptrs must point to a valid array of num_copies destination pointers
  • Each source/destination pointer pair must have at least size_per_copy bytes accessible
  • stream must be a valid CUDA stream handle