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.

138 Module DocumentationFor <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, cuMemcpy2DAsync, cuMemcpy2DUnaligned, cuMemcpy3D,cuMemcpy3DAsync, cuMemcpyAtoA, cuMemcpyAtoD, cuMemcpyAtoH, cuMemcpyAtoHAsync, cuMemcpy-DtoA, cuMemcpyDtoD, cuMemcpyDtoH, cuMemcpyDtoHAsync, cuMemcpyHtoA, cuMemcpyHtoAAsync,cuMemcpyHtoD, cuMemcpyHtoDAsync, cuMemFree, cuMemFreeHost, cuMemGetAddressRange, cuMemGet-Info, cuMemHostAlloc, cuMemHostGetDevicePointer, cuMemsetD2D8, cuMemsetD2D16, cuMemsetD2D32,cuMemsetD8, cuMemsetD16, cuMemsetD323.25.2.10 CUresult cuMemcpy2DAsync (const <strong>CUDA</strong>_MEMCPY2D ∗ pCopy, CUstream hStream)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;CUdeviceptr srcDevice;CUarray srcArray;unsigned int srcPitch;unsigned int dstXInBytes, dstY;CUmemorytype dstMemoryType;void *dstHost;CUdeviceptr dstDevice;CUarray dstArray;unsigned int dstPitch;unsigned int WidthInBytes;unsigned int Height;} <strong>CUDA</strong>_MEMCPY2D;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!