Expand description
Explicit memory copy operations between host and device.
This module provides freestanding functions for copying data between host memory, device memory, and pinned host memory. Each function validates that the source and destination have matching lengths before issuing the underlying CUDA driver call.
For simple cases, the methods on DeviceBuffer
(e.g. DeviceBuffer::copy_from_host) are more
ergonomic. These freestanding functions are useful when you want to be
explicit about the direction of the transfer or when working with
PinnedBuffer for async operations.
§Length validation
All functions return CudaError::InvalidValue if the element counts
of source and destination do not match.
Functions§
- copy_
dtod - Copies data from one device buffer to another (device-to-device).
- copy_
dtod_ async - Asynchronously copies data from one device buffer to another.
- copy_
dtoh - Copies data from a device buffer into a host slice (device-to-host).
- copy_
dtoh_ async - Asynchronously copies data from a device buffer into a pinned host buffer.
- copy_
dtoh_ async_ raw - Asynchronously copies data from a device buffer into a host slice.
- copy_
htod - Copies data from a host slice into a device buffer (host-to-device).
- copy_
htod_ async - Asynchronously copies data from a pinned host buffer into a device buffer.
- copy_
htod_ async_ raw - Asynchronously copies data from a host slice into a device buffer.