SWDEV-432490 - fix __HIP_NO_IMAGE_SUPPORT logic

1.Skip texture/image tests when __HIP_NO_IMAGE_SUPPORT is set to prevent inevitable silent failure
2.Simplify __HIP_NO_IMAGE_SUPPORT macros

Change-Id: I54ef12a239298c534a213edf39c05c2dad06a7f4


[ROCm/hip-tests commit: 0ee0e4ab4a]
This commit is contained in:
Todd tiantuo Li
2024-01-26 03:44:44 -08:00
committed by Rakesh Roy
parent 7df8798269
commit 14f6363879
26 changed files with 305 additions and 39 deletions
@@ -33,7 +33,7 @@ THE SOFTWARE.
texture<float, 2, hipReadModeElementType> texRef;
// MipMap is currently supported only on windows
#if (defined(_WIN32) && !defined(__HIP_NO_IMAGE_SUPPORT))
#if (defined(_WIN32) && !__HIP_NO_IMAGE_SUPPORT)
__global__ void tex2DKernel(float* outputData, int width, int height, float level) {
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
@@ -136,10 +136,16 @@ static void runMipMapTest(unsigned int width, unsigned int height, unsigned int
*/
TEST_CASE("Unit_hipTextureMipmapRef2D_Positive_Check") {
CHECK_IMAGE_SUPPORT
#if __HIP_NO_IMAGE_SUPPORT
HipTest::HIP_SKIP_TEST("__HIP_NO_IMAGE_SUPPORT is set");
return;
#endif
// Height Width Vector
std::vector<unsigned int> hw_vec = {2048, 1024, 512, 256, 64};
std::vector<unsigned int> mip_vec = {8, 4, 2, 1};
#if (defined(_WIN32) && !defined(__HIP_NO_IMAGE_SUPPORT))
#if (defined(_WIN32) && !__HIP_NO_IMAGE_SUPPORT)
for (auto& hw : hw_vec) {
for (auto& mip : mip_vec) {
if ((hw / static_cast<int>(pow(2, (mip * 2)))) > 0) {
@@ -175,7 +181,12 @@ TEST_CASE("Unit_hipTextureMipmapRef2D_Positive_Check") {
TEST_CASE("Unit_hipTextureMipmapRef2D_Negative_Parameters") {
CHECK_IMAGE_SUPPORT
#if (defined(_WIN32) && !defined(__HIP_NO_IMAGE_SUPPORT))
#if __HIP_NO_IMAGE_SUPPORT
HipTest::HIP_SKIP_TEST("__HIP_NO_IMAGE_SUPPORT is set");
return;
#endif
#if defined(_WIN32)
unsigned int width = 64;
unsigned int height = 64;
unsigned int mipmap_level = 1;