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.

36 Module Documentationdirection of the copy. dpitch is the width in memory in bytes of the 2D array pointed to by dst, including anypadding added to the end of each row. cudaMemcpy2DFromArray() returns an error if dpitch is greater than themaximum allowed.Parameters:dst - Destination memory addressdpitch - Pitch of destination memorysrc - Source memory addresswOffset - Source starting X offsethOffset - Source starting Y offsetwidth - Width of matrix transfer (columns in bytes)height - Height of matrix transfer (rows)kind - Type of transferReturns:Note:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidPitchValue, cudaErrorInvalidMemcpyDirectionSee also:Note that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol,cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.19 cudaError_t cudaMemcpy2DFromArrayAsync (void ∗ dst, size_t dpitch, const struct cudaArray∗ src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind,cudaStream_t stream)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 thedirection of the copy. dpitch is the width in memory in bytes of the 2D array pointed to by dst, including anypadding added to the end of each row. cudaMemcpy2DFromArrayAsync() returns an error if dpitch is greater thanthe maximum allowed.cudaMemcpy2DFromArrayAsync() 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 addressGenerated 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!