Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT (#1776)

* 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

* Remove code guarded by OBSOLETE_FORMAT

Remove code guarded by OBSOLETE_FORMAT
as suggested by review comments

Fixes #1769

* Fix formating issues for OBSOLETE_FORMAT changes

Fix formatting issues observed in files while removing
code guarded by OBSOLETE_FORMAT

Fixes #1769

* Some more formatting fixes

Some more formatting fixes to get CI clean

Fixes #1769

* Final Formating fixes

Final formatting fixes for #1769
This commit is contained in:
niranjanjoshi121
2023-12-28 12:52:13 -06:00
committed by GitHub
parent b36b2d592c
commit b041ec0a9a
3 changed files with 7 additions and 91 deletions

View File

@@ -97,23 +97,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:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_SHORT_565_REV:
case CL_UNORM_SHORT_555_REV:
#endif
return 2;
case CL_UNORM_SHORT_555: return 2;
#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_8888:
case CL_UNORM_INT_8888_REV: return 4;
#endif
case CL_UNORM_INT_101010:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_101010_REV:
#endif
return 4;
case CL_UNORM_INT_101010: return 4;
case CL_FLOAT: return sizeof(cl_float);
@@ -294,23 +280,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:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_SHORT_565_REV:
case CL_UNORM_SHORT_555_REV:
#endif
return 2;
case CL_UNORM_SHORT_555: return 2;
#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_8888:
case CL_UNORM_INT_8888_REV: return 4;
#endif
case CL_UNORM_INT_101010:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_101010_REV:
#endif
return 4;
case CL_UNORM_INT_101010: return 4;
case CL_FLOAT:
return get_format_channel_count(format) * sizeof(cl_float);

View File

@@ -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);