34 Module DocumentationReturns:Note:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidPitchValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionSee also:Note that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpy-ToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.16 cudaError_t cudaMemcpy2DArrayToArray (struct cudaArray ∗ dst, size_t wOffsetDst, size_thOffsetDst, const struct cudaArray ∗ src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_theight, enum cudaMemcpyKind kind)Copies a matrix (height rows of width bytes each) from the <strong>CUDA</strong> array srcArray starting at the upper leftcorner (wOffsetSrc, hOffsetSrc) to the <strong>CUDA</strong> array dst starting at the upper left corner (wOffsetDst,hOffsetDst), where kind is one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpyDevice-ToHost, or cudaMemcpyDeviceToDevice, and specifies the direction of the copy.Parameters:dst - Destination memory addresswOffsetDst - Destination starting X offsethOffsetDst - Destination starting Y offsetsrc - Source memory addresswOffsetSrc - Source starting X offsethOffsetSrc - Source starting Y offsetwidth - Width of matrix transfer (columns in bytes)height - Height of matrix transfer (rows)kind - Type of transferReturns:Note:See also:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol, cudaMemcpyAsync,cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync, cudaMemcpyFromArrayAsync,cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsyncGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen
3.8 Memory Management 353.8.2.17 cudaError_t cudaMemcpy2DAsync (void ∗ dst, size_t dpitch, const void ∗ src, size_t spitch, size_twidth, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream)Copies a matrix (height rows of width bytes each) from the memory area pointed to by src to the memory areapointed to by dst, where kind is one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpyDeviceToHost,or cudaMemcpyDeviceToDevice, and specifies the direction of the copy. dpitch and spitch are thewidths in memory in bytes of the 2D arrays pointed to by dst and src, including any padding added to the endof each row. The memory areas may not overlap. Calling cudaMemcpy2DAsync() with dst and src pointers thatdo not match the direction of the copy results in an undefined behavior. cudaMemcpy2DAsync() returns an error ifdpitch or spitch is greater than the maximum allowed.cudaMemcpy2DAsync() is asynchronous with respect to the host, so the call may return before the copy is complete.It only works on page-locked host memory and returns an error if a pointer to pageable memory is passed as input.The copy can optionally be associated to a stream by passing a non-zero stream argument. If kind is cudaMemcpyHostToDeviceor cudaMemcpyDeviceToHost and stream is non-zero, the copy may overlap with operations inother streams.IMPORTANT NOTE: Copies with kind == cudaMemcpyDeviceToDevice are asynchronous with respect to thehost, but never overlap with kernel execution.Parameters:dst - Destination memory addressdpitch - Pitch of destination memorysrc - Source memory addressspitch - Pitch of source memorywidth - Width of matrix transfer (columns in bytes)height - Height of matrix transfer (rows)kind - Type of transferstream - Stream identifierReturns:Note:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidPitchValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionSee also:Note that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.18 cudaError_t cudaMemcpy2DFromArray (void ∗ dst, size_t dpitch, const struct cudaArray ∗ src,size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind)Copies a matrix (height rows of width bytes each) from the <strong>CUDA</strong> array srcArray starting at the upper leftcorner (wOffset, hOffset) to the memory area pointed to by dst, where kind is one of cudaMemcpyHost-ToHost, cudaMemcpyHostToDevice, cudaMemcpyDeviceToHost, or cudaMemcpyDeviceToDevice, and specifies theGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen