Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT #1776

Merged
merged 5 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 4 additions & 32 deletions test_common/harness/imageHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +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:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_SHORT_565_REV:
case CL_UNORM_SHORT_555_REV:
#endif
return 2;

#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_8888:
case CL_UNORM_INT_8888_REV: return 4;
#endif
case CL_UNORM_SHORT_555: return 2;

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

Expand Down Expand Up @@ -293,23 +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:
#ifdef OBSOLETE_FORAMT
case CL_UNORM_SHORT_565_REV:
case CL_UNORM_SHORT_555_REV:
#endif
return 2;

#ifdef OBSOLETE_FORAMT
case CL_UNORM_INT_8888:
case CL_UNORM_INT_8888_REV: return 4;
#endif
case CL_UNORM_SHORT_555: return 2;

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);
Expand Down
42 changes: 0 additions & 42 deletions test_common/harness/imageHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 3 additions & 17 deletions test_conformance/images/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,12 @@
#include "common.h"

cl_channel_type floatFormats[] = {
CL_UNORM_SHORT_565,
CL_UNORM_SHORT_555,
CL_UNORM_INT_101010,
#ifdef OBSOLETE_FORAMT
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
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[] = {
Expand Down
Loading