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.

140 Module DocumentationFor device pointers, the starting address isCUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;For <strong>CUDA</strong> arrays, dstXInBytes must be evenly divisible by the array element size.• WidthInBytes and Height specify the width (in bytes) and height of the 2D copy being performed. Any pitchesmust be greater than or equal to WidthInBytes.cuMemcpy2D() returns an error if any pitch is greater than the maximum allowed (CU_DEVICE_ATTRIBUTE_-MAX_PITCH). cuMemAllocPitch() passes back pitches that always work with cuMemcpy2D(). On intra-devicememory copies (device ? device, <strong>CUDA</strong> array ? device, <strong>CUDA</strong> array ? <strong>CUDA</strong> array), cuMemcpy2D() may failfor pitches not computed by cuMemAllocPitch(). cuMemcpy2DUnaligned() does not have this restriction, butmay run significantly slower in the cases where cuMemcpy2D() would have returned an error code.cuMemcpy2DAsync() is asynchronous and can optionally be associated to a stream by passing a non-zero hStreamargument. It only works on page-locked host memory and returns an error if a pointer to pageable memory is passedas input.Parameters:pCopy - Parameters for the memory copyhStream - Stream identifierReturns:Note:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUESee also:Note that this function may also return error codes from previous, asynchronous launches.cuArray3DCreate, cuArray3DGetDescriptor, cuArrayCreate, cuArrayDestroy, cuArrayGetDescriptor, cuMemAlloc,cuMemAllocHost, cuMemAllocPitch, cuMemcpy2D, cuMemcpy2DUnaligned, cuMemcpy3D, cuMemcpy3DAsync,cuMemcpyAtoA, cuMemcpyAtoD, cuMemcpyAtoH, cuMemcpyAtoHAsync, cuMemcpyDtoA,cuMemcpyDtoD, cuMemcpyDtoH, cuMemcpyDtoHAsync, cuMemcpyHtoA, cuMemcpyHtoAAsync,cuMemcpyHtoD, cuMemcpyHtoDAsync, cuMemFree, cuMemFreeHost, cuMemGetAddressRange, cuMemGet-Info, cuMemHostAlloc, cuMemHostGetDevicePointer, cuMemsetD2D8, cuMemsetD2D16, cuMemsetD2D32,cuMemsetD8, cuMemsetD16, cuMemsetD323.25.2.11 CUresult cuMemcpy2DUnaligned (const <strong>CUDA</strong>_MEMCPY2D ∗ pCopy)Perform a 2D memory copy according to the parameters specified in pCopy. The <strong>CUDA</strong>_MEMCPY2D structure isdefined as:typedef struct <strong>CUDA</strong>_MEMCPY2D_st {unsigned int srcXInBytes, srcY;CUmemorytype srcMemoryType;const void *srcHost;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!