clc: add support for cl_khr_subgroup_shuffle and shuffle_relative

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
This commit is contained in:
Karol Herbst
2023-12-04 16:26:24 +01:00
committed by Marge Bot
parent a217eb111c
commit 7e78802028
3 changed files with 11 additions and 2 deletions
+2
View File
@@ -64,6 +64,8 @@ struct clc_optional_features {
* progress
*/
bool subgroups_ifp;
bool subgroups_shuffle;
bool subgroups_shuffle_relative;
};
struct clc_compile_args {
+8
View File
@@ -812,6 +812,14 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
clang_opts.push_back("-D__opencl_c_integer_dot_product_input_4x8bit_packed=1");
clang_opts.push_back("-D__opencl_c_integer_dot_product_input_4x8bit=1");
}
if (args->features.subgroups) {
if (args->features.subgroups_shuffle) {
clang_opts.push_back("-Dcl_khr_subgroup_shuffle=1");
}
if (args->features.subgroups_shuffle_relative) {
clang_opts.push_back("-Dcl_khr_subgroup_shuffle_relative=1");
}
}
// We assume there's appropriate defines for __OPENCL_VERSION__ and __IMAGE_SUPPORT__
// being provided by the caller here.
+1 -2
View File
@@ -1029,9 +1029,8 @@ impl Device {
images_read_write: self.image_read_write_supported(),
images_write_3d: self.image_3d_write_supported(),
integer_dot_product: true,
intel_subgroups: false,
subgroups: self.subgroups_supported(),
subgroups_ifp: false,
..Default::default()
}
}
}