From af06ec0cb5a974ab240d7a92fb2ec81780608428 Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 Date: Sat, 24 Jun 2023 02:05:21 -0500 Subject: [PATCH 1/5] Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT In imageHelpers.cpp and few other places in image tests, OBSOLETE_FORMAT is misspelled as OBSOLETE_FORAMT. Fix misspelling by replcaing it with OBSOLETE_FORMAT. Fixes #1769 --- test_common/harness/imageHelpers.cpp | 12 ++++++------ test_conformance/images/common.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index 3a5c5533a..6b50e8209 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -97,19 +97,19 @@ uint32_t get_channel_data_type_size(cl_channel_type channelType) case CL_UNORM_SHORT_565: case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_SHORT_565_REV: case CL_UNORM_SHORT_555_REV: #endif return 2; -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_INT_8888: case CL_UNORM_INT_8888_REV: return 4; #endif case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_INT_101010_REV: #endif return 4; @@ -294,19 +294,19 @@ uint32_t get_pixel_size(const cl_image_format *format) case CL_UNORM_SHORT_565: case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_SHORT_565_REV: case CL_UNORM_SHORT_555_REV: #endif return 2; -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_INT_8888: case CL_UNORM_INT_8888_REV: return 4; #endif case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT case CL_UNORM_INT_101010_REV: #endif return 4; diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 7323f11c1..2b9ac91ec 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -19,7 +19,7 @@ cl_channel_type floatFormats[] = { CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, -#ifdef OBSOLETE_FORAMT +#ifdef OBSOLETE_FORMAT CL_UNORM_SHORT_565_REV, CL_UNORM_SHORT_555_REV, CL_UNORM_INT_8888, From 87d0587fdfc5d50480c16386b9957e9e4923e387 Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 Date: Wed, 13 Sep 2023 07:46:22 -0500 Subject: [PATCH 2/5] Remove code guarded by OBSOLETE_FORMAT Remove code guarded by OBSOLETE_FORMAT as suggested by review comments Fixes #1769 --- test_common/harness/imageHelpers.cpp | 22 --------------- test_common/harness/imageHelpers.h | 42 ---------------------------- test_conformance/images/common.cpp | 7 ----- 3 files changed, 71 deletions(-) diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index 6b50e8209..c80c4494d 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -97,21 +97,10 @@ uint32_t get_channel_data_type_size(cl_channel_type channelType) case CL_UNORM_SHORT_565: case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORMAT - case CL_UNORM_SHORT_565_REV: - case CL_UNORM_SHORT_555_REV: -#endif return 2; -#ifdef OBSOLETE_FORMAT - case CL_UNORM_INT_8888: - case CL_UNORM_INT_8888_REV: return 4; -#endif case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORMAT - case CL_UNORM_INT_101010_REV: -#endif return 4; case CL_FLOAT: return sizeof(cl_float); @@ -294,21 +283,10 @@ uint32_t get_pixel_size(const cl_image_format *format) case CL_UNORM_SHORT_565: case CL_UNORM_SHORT_555: -#ifdef OBSOLETE_FORMAT - case CL_UNORM_SHORT_565_REV: - case CL_UNORM_SHORT_555_REV: -#endif return 2; -#ifdef OBSOLETE_FORMAT - case CL_UNORM_INT_8888: - case CL_UNORM_INT_8888_REV: return 4; -#endif case CL_UNORM_INT_101010: -#ifdef OBSOLETE_FORMAT - case CL_UNORM_INT_101010_REV: -#endif return 4; case CL_FLOAT: diff --git a/test_common/harness/imageHelpers.h b/test_common/harness/imageHelpers.h index e728a939c..0670c68c7 100644 --- a/test_common/harness/imageHelpers.h +++ b/test_common/harness/imageHelpers.h @@ -347,48 +347,6 @@ void read_image_pixel(void *imageData, image_descriptor *imageInfo, int x, break; } -#ifdef OBSOLETE_FORMAT - case CL_UNORM_SHORT_565_REV: { - unsigned short *dPtr = (unsigned short *)ptr; - tempData[2] = (T)(dPtr[0] >> 11); - tempData[1] = (T)((dPtr[0] >> 5) & 63); - tempData[0] = (T)(dPtr[0] & 31); - break; - } - - case CL_UNORM_SHORT_555_REV: { - unsigned short *dPtr = (unsigned short *)ptr; - tempData[2] = (T)((dPtr[0] >> 10) & 31); - tempData[1] = (T)((dPtr[0] >> 5) & 31); - tempData[0] = (T)(dPtr[0] & 31); - break; - } - - case CL_UNORM_INT_8888: { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[3] = (T)(dPtr[0] >> 24); - tempData[2] = (T)((dPtr[0] >> 16) & 0xff); - tempData[1] = (T)((dPtr[0] >> 8) & 0xff); - tempData[0] = (T)(dPtr[0] & 0xff); - break; - } - case CL_UNORM_INT_8888_REV: { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[0] = (T)(dPtr[0] >> 24); - tempData[1] = (T)((dPtr[0] >> 16) & 0xff); - tempData[2] = (T)((dPtr[0] >> 8) & 0xff); - tempData[3] = (T)(dPtr[0] & 0xff); - break; - } - - case CL_UNORM_INT_101010_REV: { - unsigned int *dPtr = (unsigned int *)ptr; - tempData[2] = (T)((dPtr[0] >> 20) & 0x3ff); - tempData[1] = (T)((dPtr[0] >> 10) & 0x3ff); - tempData[0] = (T)(dPtr[0] & 0x3ff); - break; - } -#endif case CL_UNORM_SHORT_555: { cl_ushort *dPtr = (cl_ushort *)ptr; tempData[0] = (T)((dPtr[0] >> 10) & 31); diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 2b9ac91ec..726d82701 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -19,13 +19,6 @@ cl_channel_type floatFormats[] = { CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, -#ifdef OBSOLETE_FORMAT - CL_UNORM_SHORT_565_REV, - CL_UNORM_SHORT_555_REV, - CL_UNORM_INT_8888, - CL_UNORM_INT_8888_REV, - CL_UNORM_INT_101010_REV, -#endif #ifdef CL_SFIXED14_APPLE CL_SFIXED14_APPLE, #endif From 56bd223ff1a1dbfa8f7818dd81bfeeef69300ace Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 Date: Wed, 13 Sep 2023 08:00:55 -0500 Subject: [PATCH 3/5] Fix formating issues for OBSOLETE_FORMAT changes Fix formatting issues observed in files while removing code guarded by OBSOLETE_FORMAT Fixes #1769 --- test_common/harness/imageHelpers.cpp | 14 ++++---------- test_conformance/images/common.cpp | 13 +++---------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/test_common/harness/imageHelpers.cpp b/test_common/harness/imageHelpers.cpp index c80c4494d..9ff4aae12 100644 --- a/test_common/harness/imageHelpers.cpp +++ b/test_common/harness/imageHelpers.cpp @@ -96,12 +96,9 @@ uint32_t get_channel_data_type_size(cl_channel_type channelType) case CL_UNSIGNED_INT32: return sizeof(cl_int); case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: - return 2; - + case CL_UNORM_SHORT_555: return 2; - case CL_UNORM_INT_101010: - return 4; + case CL_UNORM_INT_101010: return 4; case CL_FLOAT: return sizeof(cl_float); @@ -282,12 +279,9 @@ uint32_t get_pixel_size(const cl_image_format *format) return get_format_channel_count(format) * sizeof(cl_int); case CL_UNORM_SHORT_565: - case CL_UNORM_SHORT_555: - return 2; - + case CL_UNORM_SHORT_555: return 2; - case CL_UNORM_INT_101010: - return 4; + case CL_UNORM_INT_101010: return 4; case CL_FLOAT: return get_format_channel_count(format) * sizeof(cl_float); diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 726d82701..0eda89674 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -16,19 +16,12 @@ #include "common.h" cl_channel_type floatFormats[] = { - CL_UNORM_SHORT_565, - CL_UNORM_SHORT_555, - CL_UNORM_INT_101010, + CL_UNORM_SHORT_565, CL_UNORM_SHORT_555, CL_UNORM_INT_101010, #ifdef CL_SFIXED14_APPLE CL_SFIXED14_APPLE, #endif - CL_UNORM_INT8, - CL_SNORM_INT8, - CL_UNORM_INT16, - CL_SNORM_INT16, - CL_FLOAT, - CL_HALF_FLOAT, - (cl_channel_type)-1, + CL_UNORM_INT8, CL_SNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT16, + CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1, }; cl_channel_type intFormats[] = { From 24d86aa025e397b58c564c4e952e826636ea2b50 Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 Date: Wed, 13 Sep 2023 08:05:10 -0500 Subject: [PATCH 4/5] Some more formatting fixes Some more formatting fixes to get CI clean Fixes #1769 --- test_conformance/images/common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 0eda89674..2d4476790 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -20,8 +20,8 @@ cl_channel_type floatFormats[] = { #ifdef CL_SFIXED14_APPLE CL_SFIXED14_APPLE, #endif - CL_UNORM_INT8, CL_SNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT16, - CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1, + CL_UNORM_INT8, CL_SNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT16, + CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1, }; cl_channel_type intFormats[] = { From 8dcba315948709259ab3ce5094e774b55d102129 Mon Sep 17 00:00:00 2001 From: niranjanjoshi121 Date: Wed, 13 Sep 2023 08:09:24 -0500 Subject: [PATCH 5/5] Final Formating fixes Final formatting fixes for #1769 --- test_conformance/images/common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_conformance/images/common.cpp b/test_conformance/images/common.cpp index 2d4476790..0b2c956cc 100644 --- a/test_conformance/images/common.cpp +++ b/test_conformance/images/common.cpp @@ -20,8 +20,8 @@ cl_channel_type floatFormats[] = { #ifdef CL_SFIXED14_APPLE CL_SFIXED14_APPLE, #endif - CL_UNORM_INT8, CL_SNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT16, - CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1, + CL_UNORM_INT8, CL_SNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT16, + CL_FLOAT, CL_HALF_FLOAT, (cl_channel_type)-1, }; cl_channel_type intFormats[] = {