Skip to content

Commit b5e9bc5

Browse files
manocharahulRahul Manocha
andauthored
SWDEV-475482 - [6.4 Preview] Match hipTexObjectCreate with cuda (#408)
Co-authored-by: Rahul Manocha <[email protected]>
1 parent 988c42a commit b5e9bc5

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

hipamd/src/hip_memory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
10931093
imageType,
10941094
CL_MEM_READ_WRITE,
10951095
imageFormat,
1096-
imageWidth,
1096+
(imageWidth == 0) ? 1 : imageWidth,
10971097
(imageHeight == 0) ? 1 : imageHeight,
10981098
(imageDepth == 0) ? 1 : imageDepth,
10991099
imageRowPitch,

rocclr/platform/memory.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,6 @@ bool Image::validateDimensions(const std::vector<amd::Device*>& devices, cl_mem_
685685
}
686686
// Fall through...
687687
case CL_MEM_OBJECT_IMAGE2D:
688-
if ((width == 0) || (height == 0)) {
689-
DevLogPrintfError("Invalid dimensions width: %u height: %u \n", width, height);
690-
return false;
691-
}
692688
for (const auto dev : devices) {
693689
if ((dev->info().image2DMaxHeight_ >= height) && (dev->info().image2DMaxWidth_ >= width)) {
694690
return true;
@@ -724,10 +720,6 @@ bool Image::validateDimensions(const std::vector<amd::Device*>& devices, cl_mem_
724720
}
725721
break;
726722
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
727-
if (width == 0) {
728-
DevLogError("Invalid dimension \n");
729-
return false;
730-
}
731723
for (const auto& dev : devices) {
732724
if (dev->info().imageMaxBufferSize_ >= width) {
733725
return true;

0 commit comments

Comments
 (0)