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.

142 Module DocumentationCUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;For <strong>CUDA</strong> arrays, srcXInBytes must be evenly divisible by the array element size.• dstXInBytes and dstY specify the base address of the destination data for the copy.For host pointers, the base address isvoid* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);For 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.Parameters:pCopy - Parameters for the memory copyReturns: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, cuMemcpy2DAsync, 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, cuMemsetD32Generated 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!