images: Stop checking gDeviceType != CL_DEVICE_TYPE_GPU (#1418)

* images: Stop checking gDeviceType != CL_DEVICE_TYPE_GPU

If the device type also advertises CL_DEVICE_TYPE_DEFAULT (which should
be valid), this causes it to be considered a CPU device and the tests
enforce different precision and rounding expectations.

* Fix clang-format

* Drop redundant NORM_OFFSET checks
This commit is contained in:
Jason Ekstrand
2022-05-17 10:51:53 -05:00
committed by GitHub
parent 5149de2277
commit 6e6249fb48
6 changed files with 169 additions and 66 deletions

View File

@@ -84,7 +84,7 @@ int test_read_image_type(cl_device_id device, cl_context context,
// of operations for linear filtering on the GPU. We do not test linear
// filtering for the CL_RGB CL_UNORM_INT_101010 image format; however, we
// test it internally for a set of other image formats.
if ((gDeviceType == CL_DEVICE_TYPE_GPU)
if ((gDeviceType & CL_DEVICE_TYPE_GPU)
&& (imageSampler->filter_mode == CL_FILTER_LINEAR)
&& (format->image_channel_order == CL_RGB)
&& (format->image_channel_data_type == CL_UNORM_INT_101010))