From b3db418e06c462862cb81b92c2358350fde119c3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemp Date: Wed, 5 Aug 2020 14:55:35 +0100 Subject: [PATCH] Skip sub_group_dispatch. (#864) * Skip sub_group_dispatch. If sub groups aren't supported, skip the test. * Do not test for cl_khr_subgroups as the extension requires IFP. 3.0 allows sub groups *without* IFP so the check was invalid. --- .../api/test_sub_group_dispatch.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test_conformance/api/test_sub_group_dispatch.cpp b/test_conformance/api/test_sub_group_dispatch.cpp index c0dc372c..387d6c39 100644 --- a/test_conformance/api/test_sub_group_dispatch.cpp +++ b/test_conformance/api/test_sub_group_dispatch.cpp @@ -75,6 +75,26 @@ int test_sub_group_dispatch(cl_device_id deviceID, cl_context context, cl_comman size_t ret_ndrange2d_flattened; size_t ret_ndrange3d_flattened; + if (get_device_cl_version(deviceID) >= Version(3, 0)) + { + int error; + cl_uint max_num_sub_groups; + + error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_NUM_SUB_GROUPS, + sizeof(max_num_sub_groups), &max_num_sub_groups, + NULL); + if (error != CL_SUCCESS) + { + print_error(error, "Unable to get max num subgroups"); + return error; + } + + if (max_num_sub_groups == 0) + { + return TEST_SKIPPED_ITSELF; + } + } + error = create_single_kernel_helper_with_build_options(context, &program, &kernel, 1, subgroup_dispatch_kernel, "subgroup_dispatch_kernel", "-cl-std=CL2.0"); if (error != 0) return error;