cuda.bindings._v2.driver.memcpy_2d_async_v2#
- cuda.bindings._v2.driver.memcpy_2d_async_v2(p_copy, intptr_t h_stream)#
Copies memory for 2D arrays.
Perform a 2D memory copy according to the parameters specified in
p_copy. TheCUDA_MEMCPY2Dstructure 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_HOST,srcHostandsrcPitchspecify the (host) base address of the source data and the bytes per row to apply.srcArrayis ignored. IfsrcMemoryTypeisCU_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_DEVICE,srcDeviceandsrcPitchspecify the (device) base address of the source data and the bytes per row to apply.srcArrayis ignored. IfsrcMemoryTypeisCU_MEMORYTYPE_ARRAY,srcArrayspecifies the handle of the source data.srcHost,srcDeviceandsrcPitchare 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 and the bytes per row to apply.dstArrayis ignored. IfdstMemoryTypeisCU_MEMORYTYPE_DEVICE,dstDeviceanddstPitchspecify the (device) base address of the destination data and the bytes per row to apply.dstArrayis ignored. IfdstMemoryTypeisCU_MEMORYTYPE_ARRAY,dstArrayspecifies the handle of the destination data.dstHost,dstDeviceanddstPitchare ignored.srcXInBytesandsrcYspecify 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.dstXInBytesanddstYspecify 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.WidthInBytesandHeightspecify the width (in bytes) and height of the 2D copy being performed.If specified,
srcPitchmust be greater than or equal toWidthInBytes+srcXInBytes, anddstPitchmust be greater than or equal toWidthInBytes+ dstXInBytes.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.
cuMemcpy2DAsync()returns an error if any pitch is greater than the maximum allowed (CU_DEVICE_ATTRIBUTE_MAX_PITCH).cuMemAllocPitch()passes back pitches that always work withcuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array),cuMemcpy2DAsync()may fail for pitches not computed bycuMemAllocPitch().- Parameters:
p_copy (intptr_t) – Parameters for the memory copy.
h_stream (intptr_t) – Stream identifier.
See also
cuMemcpy2DAsync_v2