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

@@ -557,7 +557,7 @@ int test_read_image(cl_context context, cl_command_queue queue,
// Apple requires its CPU implementation to do
// correctly rounded address arithmetic in all
// modes
|| gDeviceType != CL_DEVICE_TYPE_GPU
|| !(gDeviceType & CL_DEVICE_TYPE_GPU)
#endif
)
offset = 0.0f; // Loop only once
@@ -875,7 +875,7 @@ int test_read_image(cl_context context, cl_command_queue queue,
// Apple requires its CPU implementation to do
// correctly rounded address arithmetic in all
// modes
|| gDeviceType != CL_DEVICE_TYPE_GPU
|| !(gDeviceType & CL_DEVICE_TYPE_GPU)
#endif
)
offset = 0.0f; // Loop only once
@@ -1214,7 +1214,8 @@ int test_read_image(cl_context context, cl_command_queue queue,
// offsets (0.0, 0.0) E.g., test one
// pixel.
if (!imageSampler->normalized_coords
|| gDeviceType != CL_DEVICE_TYPE_GPU
|| !(gDeviceType
& CL_DEVICE_TYPE_GPU)
|| NORM_OFFSET == 0)
{
norm_offset_x = 0.0f;
@@ -1396,7 +1397,8 @@ int test_read_image(cl_context context, cl_command_queue queue,
// offsets (0.0, 0.0) E.g., test one
// pixel.
if (!imageSampler->normalized_coords
|| gDeviceType != CL_DEVICE_TYPE_GPU
|| !(gDeviceType
& CL_DEVICE_TYPE_GPU)
|| NORM_OFFSET == 0)
{
norm_offset_x = 0.0f;