11.01.2014 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

166 Module Documentation<br />

If dstMemoryType is CU_MEMORYTYPE_ARRAY, dstArray specifies the handle of the destination data.<br />

dstHost, dstDevice, dstPitch and dstHeight are ignored.<br />

• srcXInBytes, srcY and srcZ specify the base address of the source data for the copy.<br />

For host pointers, the starting address is<br />

void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes);<br />

For device pointers, the starting address is<br />

CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes;<br />

For <strong>CUDA</strong> arrays, srcXInBytes must be evenly divisible by the array element size.<br />

• dstXInBytes, dstY and dstZ specify the base address of the destination data for the copy.<br />

For host pointers, the base address is<br />

void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes);<br />

For device pointers, the starting address is<br />

CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes;<br />

For <strong>CUDA</strong> arrays, dstXInBytes must be evenly divisible by the array element size.<br />

• WidthInBytes, Height and Depth specify the width (in bytes), height and depth of the 3D copy being performed.<br />

Any pitches must be greater than or equal to WidthInBytes.<br />

cuMemcpy3D() returns an error if any pitch is greater than the maximum allowed (CU_DEVICE_ATTRIBUTE_-<br />

MAX_PITCH).<br />

The srcLOD and dstLOD members of the <strong>CUDA</strong>_MEMCPY3D structure must be set to 0.<br />

Parameters:<br />

pCopy - Parameters for the memory copy<br />

Returns:<br />

Note:<br />

<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-<br />

ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE<br />

Note that this function may also return error codes from previous, asynchronous launches.<br />

Generated 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!