From efce2f77c4b5a1b9a2c16f33b7b9062faf09b007 Mon Sep 17 00:00:00 2001 From: Rahul Manocha Date: Mon, 29 Jul 2024 12:33:13 -0700 Subject: [PATCH] SWDEV-475482 - hipTexObjectCreate align with cuda Support zero width and height for hipTextObjectCreate to align with cuda. Change-Id: I5d4c48625faf5f060ed2a7e634ec65e4ecac9da5 --- hipamd/src/hip_memory.cpp | 2 +- rocclr/platform/memory.cpp | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 58133d981c..665c9aa998 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -1063,7 +1063,7 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder, imageType, CL_MEM_READ_WRITE, imageFormat, - imageWidth, + (imageWidth == 0) ? 1 : imageWidth, (imageHeight == 0) ? 1 : imageHeight, (imageDepth == 0) ? 1 : imageDepth, imageRowPitch, diff --git a/rocclr/platform/memory.cpp b/rocclr/platform/memory.cpp index a887a2c95a..c376d0abf6 100644 --- a/rocclr/platform/memory.cpp +++ b/rocclr/platform/memory.cpp @@ -675,10 +675,6 @@ bool Image::validateDimensions(const std::vector& devices, cl_mem_ } // Fall through... case CL_MEM_OBJECT_IMAGE2D: - if ((width == 0) || (height == 0)) { - DevLogPrintfError("Invalid dimensions width: %u height: %u \n", width, height); - return false; - } for (const auto dev : devices) { if ((dev->info().image2DMaxHeight_ >= height) && (dev->info().image2DMaxWidth_ >= width)) { return true; @@ -714,10 +710,6 @@ bool Image::validateDimensions(const std::vector& devices, cl_mem_ } break; case CL_MEM_OBJECT_IMAGE1D_BUFFER: - if (width == 0) { - DevLogError("Invalid dimension \n"); - return false; - } for (const auto& dev : devices) { if (dev->info().imageMaxBufferSize_ >= width) { return true;