cuda.bindings._v2.driver.memcpy_3d_v2#
- cuda.bindings._v2.driver.memcpy_3d_v2(p_copy)#
Copies memory for 3D arrays.
Perform a 3D memory copy according to the parameters specified in
p_copy. TheCUDA_MEMCPY3Dstructure is defined as:. **View CUDA Toolkit Documentation for a C++ code example**. where:.srcMemoryTypeanddstMemoryTypespecify the type of memory of the source and destination, respectively;CUmemorytype_enumis defined as:.
**View CUDA Toolkit Documentation for a C++ code example**. If
srcMemoryTypeisCU_MEMORYTYPE_UNIFIED,srcDeviceandsrcPitchspecify the (unified virtual address space) base address of the source data and the bytes per row to apply.srcArrayis ignored. This value may be used only if unified addressing is supported in the calling context. IfsrcMemoryTypeisCU_MEMORYTYPE_HOST,srcHost,srcPitchandsrcHeightspecify the (host) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array.srcArrayis ignored. IfsrcMemoryTypeisCU_MEMORYTYPE_DEVICE,srcDevice,srcPitchandsrcHeightspecify the (device) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array.srcArrayis ignored. IfsrcMemoryTypeisCU_MEMORYTYPE_ARRAY,srcArrayspecifies the handle of the source data.srcHost,srcDevice,srcPitchandsrcHeightare ignored. IfdstMemoryTypeisCU_MEMORYTYPE_UNIFIED,dstDeviceanddstPitchspecify the (unified virtual address space) base address of the source data and the bytes per row to apply.dstArrayis ignored. This value may be used only if unified addressing is supported in the calling context. IfdstMemoryTypeisCU_MEMORYTYPE_HOST,dstHostanddstPitchspecify the (host) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array.dstArrayis ignored. IfdstMemoryTypeisCU_MEMORYTYPE_DEVICE,dstDeviceanddstPitchspecify the (device) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array.dstArrayis ignored. IfdstMemoryTypeisCU_MEMORYTYPE_ARRAY,dstArrayspecifies the handle of the destination data.dstHost,dstDevice,dstPitchanddstHeightare ignored.srcXInBytes,srcYandsrcZspecify the base address of the source data for the copy.
For host pointers, the starting address is. **View CUDA Toolkit Documentation for a C++ code example**. For device pointers, the starting address is. **View CUDA Toolkit Documentation for a C++ code example**. For CUDA arrays,
srcXInBytesmust be evenly divisible by the array element size.dstXInBytes,
dstYanddstZspecify the base address of the destination data for the copy.
For host pointers, the base address is. **View CUDA Toolkit Documentation for a C++ code example**. For device pointers, the starting address is. **View CUDA Toolkit Documentation for a C++ code example**. For CUDA arrays,
dstXInBytesmust be evenly divisible by the array element size.WidthInBytes,HeightandDepthspecify the width (in bytes), height and depth of the 3D copy being performed.If specified,
srcPitchmust be greater than or equal toWidthInBytes+srcXInBytes, anddstPitchmust be greater than or equal toWidthInBytes+ dstXInBytes.If specified,
srcHeightmust be greater than or equal toHeight+srcY, anddstHeightmust be greater than or equal toHeight+dstY.
cuMemcpy3D()returns an error if any pitch is greater than the maximum allowed (CU_DEVICE_ATTRIBUTE_MAX_PITCH). ThesrcLODanddstLODmembers of theCUDA_MEMCPY3Dstructure must be set to 0.- Parameters:
p_copy (intptr_t) – Parameters for the memory copy.
See also
cuMemcpy3D_v2