Test image formats of cl_ext_image_unsigned_10x6_12x4_14x2 (#2375)

This change add the following image formats to the supported image
formats:
1. CL_UNSIGNED_INT10X6_EXT
2. CL_UNSIGNED_INT12X4_EXT
3. CL_UNSIGNED_INT14X2_EXT
4. CL_UNORM_INT10X6_EXT
5. CL_UNORM_INT12X4_EXT
6. CL_UNORM_INT14X2_EXT

For reference, the specification for
`cl_ext_image_unsigned_10x6_12x4_14x2` can be found here:
https://github.com/KhronosGroup/OpenCL-Docs/pull/1352

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Co-authored-by: Michael Rizkalla <michael.rizkalla@arm.com>
This commit is contained in:
Ahmed Hesham
2025-05-27 16:57:34 +01:00
committed by GitHub
parent dec5644112
commit 3ab4d8aab2
6 changed files with 227 additions and 9 deletions

View File

@@ -448,6 +448,27 @@ void read_image_pixel(void *imageData, image_descriptor *imageInfo, int x,
tempData[0] = (T)(hi_val | lo_val);
break;
}
case CL_UNSIGNED_INT10X6_EXT: {
cl_short *dPtr = (cl_short *)ptr;
const size_t channelCount = get_format_channel_count(format);
for (i = 0; i < channelCount; i++)
tempData[i] = (dPtr[i] >> 6) & 0x3ff;
break;
}
case CL_UNSIGNED_INT12X4_EXT: {
cl_short *dPtr = (cl_short *)ptr;
const size_t channelCount = get_format_channel_count(format);
for (i = 0; i < channelCount; i++)
tempData[i] = (dPtr[i] >> 4) & 0xfff;
break;
}
case CL_UNSIGNED_INT14X2_EXT: {
cl_short *dPtr = (cl_short *)ptr;
const size_t channelCount = get_format_channel_count(format);
for (i = 0; i < channelCount; i++)
tempData[i] = (dPtr[i] >> 2) & 0x3fff;
break;
}
}