cubecl_hip_sys

Function hipMemcpyAsync

Source
pub unsafe extern "C" fn hipMemcpyAsync(
    dst: *mut c_void,
    src: *const c_void,
    sizeBytes: usize,
    kind: hipMemcpyKind,
    stream: hipStream_t,
) -> hipError_t
Expand description

@brief Copy data from src to dst asynchronously.

@warning If host or dest are not pinned, the memory copy will be performed synchronously. For best performance, use hipHostMalloc to allocate host memory that is transferred asynchronously.

@warning on HCC hipMemcpyAsync does not support overlapped H2D and D2H copies. For hipMemcpy, the copy is always performed by the device associated with the specified stream.

For multi-gpu or peer-to-peer configurations, it is recommended to use a stream which is a attached to the device where the src data is physically located. For optimal peer-to-peer copies, the copy device must be able to access the src and dst pointers (by calling hipDeviceEnablePeerAccess with copy agent as the current device and src/dest as the peerDevice argument. if this is not done, the hipMemcpy will still work, but will perform the copy using a staging buffer on the host.

@param[out] dst Data being copy to @param[in] src Data being copy from @param[in] sizeBytes Data size in bytes @param[in] kind Type of memory transfer @param[in] stream Stream identifier @return #hipSuccess, #hipErrorInvalidValue, #hipErrorUnknown

@see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyToSymbol, hipMemcpyFromSymbol, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, hipMemcpyFromSymbolAsync