12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

38 Module DocumentationNote:See also:Note that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol,cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.21 cudaError_t cudaMemcpy2DToArrayAsync (struct cudaArray ∗ dst, size_t wOffset, size_thOffset, const void ∗ src, size_t spitch, size_t width, 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 <strong>CUDA</strong> arraydst starting at the upper left corner (wOffset, hOffset) where kind is one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice,cudaMemcpyDeviceToHost, or cudaMemcpyDeviceToDevice, and specifies the direction ofthe copy. spitch is the width in memory in bytes of the 2D array pointed to by src, including any padding addedto the end of each row. cudaMemcpy2DToArrayAsync() returns an error if spitch is greater than the maximumallowed.cudaMemcpy2DToArrayAsync() is asynchronous with respect to the host, so the call may return before the copy iscomplete. It only works on page-locked host memory and returns an error if a pointer to pageable memory is passedas input. The copy can optionally be associated to a stream by passing a non-zero stream argument. If kindis cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost and stream is non-zero, the copy may overlap withoperations in other streams.IMPORTANT NOTE: Copies with kind == cudaMemcpyDeviceToDevice are asynchronous with respect to thehost, but never overlap with kernel execution.Parameters:dst - Destination memory addresswOffset - Destination starting X offsethOffset - Destination starting Y offsetsrc - 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, cudaErrorInvalidDevicePointer, cudaErrorInvalidPitchValue, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.Generated 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!