Skip to content

Commit c3c5fa4

Browse files
Testing different pitched images cases
Signed-off-by: Zhang, Winston <[email protected]>
1 parent 133f31b commit c3c5fa4

File tree

1 file changed

+16
-0
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,22 @@ ur_result_t urBindlessImagesImageCopyExp(
560560
(ZeCommandList, pDst, &ZeDstRegion, DstRowPitch, DstSlicePitch,
561561
pSrc, &ZeSrcRegion, SrcRowPitch, SrcSlicePitch, ZeEvent,
562562
WaitList.Length, WaitList.ZeEventList));
563+
564+
} else if (pSrcImageDesc->rowPitch == 0 && pDstImageDesc->rowPitch != 0) {
565+
// Handle the case where source row pitch is zero and destination row
566+
// pitch is non-zero
567+
logger::error(
568+
"urBindlessImagesImageCopyExp: Source row pitch is zero, but "
569+
"destination row pitch is non-zero. Potential "
570+
"misconfiguration detected.");
571+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
572+
} else if (pSrcImageDesc->rowPitch != 0 && pDstImageDesc->rowPitch == 0) {
573+
// Handle the case where destination row pitch is zero and source row
574+
// pitch is non-zero
575+
logger::error(
576+
"urBindlessImagesImageCopyExp: Destination row pitch is zero, but "
577+
"source row pitch is non-zero. Potential misconfiguration detected.");
578+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
563579
} else {
564580
// Copy from Non-USM memory to Non-USM memory
565581
// Copy from Non-USM/pitched USM memory to pitched USM/Non-USM memory

0 commit comments

Comments
 (0)