Skip to content

Commit 6b33f17

Browse files
committed
More fixes. copy_subregion_2D should pass now
1 parent aefb645 commit 6b33f17

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

unified-runtime/source/adapters/level_zero/image_common.cpp

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -884,22 +884,26 @@ ur_result_t bindlessImagesHandleCopyFlags(
884884
};
885885
case UR_EXP_IMAGE_COPY_FLAG_HOST_TO_HOST: {
886886
// Copy between (possibly) pitched USM regions
887-
uint32_t DstRowPitch =
888-
std::max(pDstImageDesc->rowPitch, pCopyRegion->copyExtent.width);
889-
uint32_t SrcRowPitch =
890-
std::max(pSrcImageDesc->rowPitch, pCopyRegion->copyExtent.width);
891-
ze_copy_region_t ZeDstRegion = {(uint32_t)pCopyRegion->dstOffset.x,
892-
(uint32_t)pCopyRegion->dstOffset.y,
893-
(uint32_t)pCopyRegion->dstOffset.z,
894-
(uint32_t)pCopyRegion->copyExtent.width,
895-
(uint32_t)pCopyRegion->copyExtent.height,
896-
(uint32_t)pCopyRegion->copyExtent.depth};
897-
ze_copy_region_t ZeSrcRegion = {(uint32_t)pCopyRegion->srcOffset.x,
898-
(uint32_t)pCopyRegion->srcOffset.y,
899-
(uint32_t)pCopyRegion->srcOffset.z,
900-
(uint32_t)pCopyRegion->copyExtent.width,
901-
(uint32_t)pCopyRegion->copyExtent.height,
902-
(uint32_t)pCopyRegion->copyExtent.depth};
887+
uint32_t DstRowPitch = pDstImageDesc->rowPitch;
888+
uint32_t SrcRowPitch = pSrcImageDesc->rowPitch;
889+
ze_copy_region_t ZeDstRegion = {
890+
(uint32_t)(pCopyRegion->dstOffset.x *
891+
getPixelSizeBytes(pDstImageFormat)),
892+
(uint32_t)pCopyRegion->dstOffset.y,
893+
(uint32_t)pCopyRegion->dstOffset.z,
894+
(uint32_t)(pCopyRegion->copyExtent.width *
895+
getPixelSizeBytes(pDstImageFormat)),
896+
(uint32_t)pCopyRegion->copyExtent.height,
897+
(uint32_t)pCopyRegion->copyExtent.depth};
898+
ze_copy_region_t ZeSrcRegion = {
899+
(uint32_t)(pCopyRegion->dstOffset.x *
900+
getPixelSizeBytes(pSrcImageFormat)),
901+
(uint32_t)pCopyRegion->srcOffset.y,
902+
(uint32_t)pCopyRegion->srcOffset.z,
903+
(uint32_t)(pCopyRegion->copyExtent.width *
904+
getPixelSizeBytes(pSrcImageFormat)),
905+
(uint32_t)pCopyRegion->copyExtent.height,
906+
(uint32_t)pCopyRegion->copyExtent.depth};
903907
uint32_t DstSlicePitch = DstRowPitch * pDstImageDesc->height;
904908
uint32_t SrcSlicePitch = SrcRowPitch * pSrcImageDesc->height;
905909
ZE2UR_CALL(zeCommandListAppendMemoryCopyRegion,

0 commit comments

Comments
 (0)