Function rcudnn_sys::cudaMemcpy3DAsync[][src]

pub unsafe extern "C" fn cudaMemcpy3DAsync(
    p: *const cudaMemcpy3DParms,
    stream: cudaStream_t
) -> cudaError_t
Expand description

\brief Copies data between 3D objects

\code struct cudaExtent { size_t width; size_t height; size_t depth; }; struct cudaExtent make_cudaExtent(size_t w, size_t h, size_t d);

struct cudaPos { size_t x; size_t y; size_t z; }; struct cudaPos make_cudaPos(size_t x, size_t y, size_t z);

struct cudaMemcpy3DParms { cudaArray_t srcArray; struct cudaPos srcPos; struct cudaPitchedPtr srcPtr; cudaArray_t dstArray; struct cudaPos dstPos; struct cudaPitchedPtr dstPtr; struct cudaExtent extent; enum cudaMemcpyKind kind; }; \endcode

::cudaMemcpy3DAsync() copies data betwen two 3D objects. The source and destination objects may be in either host memory, device memory, or a CUDA array. The source, destination, extent, and kind of copy performed is specified by the ::cudaMemcpy3DParms struct which should be initialized to zero before use: \code cudaMemcpy3DParms myParms = {0}; \endcode

The struct passed to ::cudaMemcpy3DAsync() must specify one of \p srcArray or \p srcPtr and one of \p dstArray or \p dstPtr. Passing more than one non-zero source or destination will cause ::cudaMemcpy3DAsync() to return an error.

The \p srcPos and \p dstPos fields are optional offsets into the source and destination objects and are defined in units of each object’s elements. The element for a host or device pointer is assumed to be unsigned char. For CUDA arrays, positions must be in the range [0, 2048) for any dimension.

The \p extent field defines the dimensions of the transferred area in elements. If a CUDA array is participating in the copy, the extent is defined in terms of that array’s elements. If no CUDA array is participating in the copy then the extents are defined in elements of unsigned char.

The \p kind field defines the direction of the copy. It must be one of ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost, ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing ::cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, ::cudaMemcpyDefault is only allowed on systems that support unified virtual addressing. For ::cudaMemcpyHostToHost or ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost passed as kind and cudaArray type passed as source or destination, if the kind implies cudaArray type to be present on the host, ::cudaMemcpy3DAsync() will disregard that implication and silently correct the kind based on the fact that cudaArray type can only be present on the device.

If the source and destination are both arrays, ::cudaMemcpy3DAsync() will return an error if they do not have the same element size.

The source and destination object may not overlap. If overlapping source and destination objects are specified, undefined behavior will result.

The source object must lie entirely within the region defined by \p srcPos and \p extent. The destination object must lie entirely within the region defined by \p dstPos and \p extent.

::cudaMemcpy3DAsync() returns an error if the pitch of \p srcPtr or \p dstPtr exceeds the maximum allowed. The pitch of a ::cudaPitchedPtr allocated with ::cudaMalloc3D() will always be valid.

::cudaMemcpy3DAsync() is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero \p stream argument. If \p kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and \p stream is non-zero, the copy may overlap with operations in other streams.

The device version of this function only handles device to device copies and cannot be given local or shared pointers.

\param p - 3D memory copy parameters \param stream - Stream identifier

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorInvalidPitchValue, ::cudaErrorInvalidMemcpyDirection \notefnerr \note_async \note_null_stream \note_init_rt \note_callback

\sa ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaMemset3D, ::cudaMemcpy3D, ::cudaMemcpy, ::cudaMemcpy2D, ::cudaMemcpy2DToArray, :::cudaMemcpy2DFromArray, ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol, ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync, ::cudaMemcpy2DToArrayAsync, ::cudaMemcpy2DFromArrayAsync, ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync, ::make_cudaExtent, ::make_cudaPos, ::cuMemcpy3DAsync