diff --git a/clang/include/clang/Basic/OpenCLExtensions.def b/clang/include/clang/Basic/OpenCLExtensions.def index 6f73b26137500..50f0cce408202 100644 --- a/clang/include/clang/Basic/OpenCLExtensions.def +++ b/clang/include/clang/Basic/OpenCLExtensions.def @@ -90,13 +90,29 @@ OPENCL_EXTENSION(__cl_clang_variadic_functions, true, 100) OPENCL_EXTENSION(__cl_clang_non_portable_kernel_param_types, true, 100) OPENCL_EXTENSION(__cl_clang_bitfields, true, 100) +// Khronos OpenCL extensions +OPENCL_EXTENSION(cl_khr_extended_bit_ops, true, 200) +OPENCL_EXTENSION(cl_khr_integer_dot_product, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_ballot, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_clustered_reduce, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_extended_types, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_named_barrier, true, 100) +OPENCL_EXTENSION(cl_khr_subgroup_non_uniform_arithmetic, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_non_uniform_vote, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_rotate, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_shuffle, true, 200) +OPENCL_EXTENSION(cl_khr_subgroup_shuffle_relative, true, 200) +OPENCL_EXTENSION(cl_khr_work_group_uniform_arithmetic, true, 200) + // AMD OpenCL extensions OPENCL_EXTENSION(cl_amd_media_ops, true, 100) OPENCL_EXTENSION(cl_amd_media_ops2, true, 100) // Intel OpenCL extensions OPENCL_EXTENSION(cl_intel_subgroups, true, 120) +OPENCL_EXTENSION(cl_intel_subgroups_char, true, 120) OPENCL_EXTENSION(cl_intel_subgroups_short, true, 120) +OPENCL_EXTENSION(cl_intel_subgroups_long, true, 120) OPENCL_EXTENSION(cl_intel_device_side_avc_motion_estimation, true, 120) // OpenCL C 3.0 features (6.2.1. Features) @@ -112,6 +128,11 @@ OPENCL_OPTIONALCOREFEATURE(__opencl_c_program_scope_global_variables, false, 300 OPENCL_OPTIONALCOREFEATURE(__opencl_c_fp64, false, 300, OCL_C_30) OPENCL_OPTIONALCOREFEATURE(__opencl_c_images, false, 300, OCL_C_30) +// Features enabled by the Khronos extensions +OPENCL_GENERIC_EXTENSION(__opencl_c_work_group_collective_functions, false, 300, 0, 0) +OPENCL_GENERIC_EXTENSION(__opencl_c_integer_dot_product_input_4x8bit, false, 300, 0, 0) +OPENCL_GENERIC_EXTENSION(__opencl_c_integer_dot_product_input_4x8bit_packed, false, 300, 0, 0) + #undef OPENCL_OPTIONALCOREFEATURE #undef OPENCL_COREFEATURE #undef OPENCL_GENERIC_EXTENSION diff --git a/clang/lib/Basic/OpenCLOptions.cpp b/clang/lib/Basic/OpenCLOptions.cpp index d39686ea688e5..9a58605294873 100644 --- a/clang/lib/Basic/OpenCLOptions.cpp +++ b/clang/lib/Basic/OpenCLOptions.cpp @@ -18,7 +18,14 @@ static const std::pair DependentFeaturesList[] = { {"__opencl_c_3d_image_writes", "__opencl_c_images"}, {"__opencl_c_pipes", "__opencl_c_generic_address_space"}, {"__opencl_c_device_enqueue", "__opencl_c_generic_address_space"}, - {"__opencl_c_device_enqueue", "__opencl_c_program_scope_global_variables"}}; + {"__opencl_c_device_enqueue", "__opencl_c_program_scope_global_variables"}, + {"__opencl_c_work_group_collective_functions", + "cl_khr_work_group_uniform_arithmetic"}, + {"__opencl_c_integer_dot_product_input_4x8bit", + "cl_khr_integer_dot_product"}, + {"__opencl_c_integer_dot_product_input_4x8bit_packed", + "cl_khr_integer_dot_product"}, +}; // Extensions and equivalent feature pairs. static const std::pair FeatureExtensionMap[] = {