12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.8 Memory Management 41The struct passed to cudaMemcpy3DAsync() must specify one of srcArray or srcPtr and one of dstArray ordstPtr. Passing more than one non-zero source or destination will cause cudaMemcpy3DAsync() to return an error.The srcPos and dstPos fields are optional offsets into the source and destination objects and are defined in units ofeach object’s elements. The element for a host or device pointer is assumed to be unsigned char. For <strong>CUDA</strong> arrays,positions must be in the range [0, 2048) for any dimension.The extent field defines the dimensions of the transferred area in elements. If a <strong>CUDA</strong> array is participating in thecopy, the extent is defined in terms of that array’s elements. If no <strong>CUDA</strong> array is participating in the copy then theextents are defined in elements of unsigned char.The kind field defines the direction of the copy. It must be one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice,cudaMemcpyDeviceToHost, or cudaMemcpyDeviceToDevice.If the source and destination are both arrays, cudaMemcpy3DAsync() will return an error if they do not have the sameelement size.The source and destination object may not overlap. If overlapping source and destination objects are specified, undefinedbehavior will result.cudaMemcpy3DAsync() returns an error if the pitch of srcPtr or dstPtr is greater than 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.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:p - 3D memory copy parametersstream - Stream identifierReturns:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidPitchValue, cudaErrorInvalidMemcpyDirectionNote:Note that this function may also return error codes from previous, asynchronous launches.See also:cudaMalloc3D, cudaMalloc3DArray, cudaMemset3D, cudaMemcpy3D, cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray,cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray, cudaMemcpyArrayToArray,cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol, cudaMemcpyAsync,cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync, cudaMemcpyFromArrayAsync,cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync,make_cudaExtent, make_cudaPosGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!