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 333.8.2.14 cudaError_t cudaMemcpy (void ∗ dst, const void ∗ src, size_t count, enum cudaMemcpyKind kind)Copies count bytes from the memory area pointed to by src to the memory area pointed to by dst, where kind isone of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpyDeviceToHost, or cudaMemcpyDevice-ToDevice, and specifies the direction of the copy. The memory areas may not overlap. Calling cudaMemcpy() withdst and src pointers that do not match the direction of the copy results in an undefined behavior.Parameters:dst - Destination memory addresssrc - Source memory addresscount - Size in bytes to copykind - Type of transferReturns:Note:See also:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpy-ToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.15 cudaError_t cudaMemcpy2D (void ∗ dst, size_t dpitch, const void ∗ src, size_t spitch, size_t width,size_t height, enum cudaMemcpyKind kind)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 end ofeach row. The memory areas may not overlap. Calling cudaMemcpy2D() with dst and src pointers that do notmatch the direction of the copy results in an undefined behavior. cudaMemcpy2D() returns an error if dpitch orspitch is greater than the maximum allowed.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 transferGenerated 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!