rusticl/clc add integer_dot_prod feature macros

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23011>
This commit is contained in:
norablackcat 2023-05-18 08:05:08 -06:00 committed by Marge Bot
parent 40f1f25f56
commit 75555d0660
2 changed files with 9 additions and 0 deletions

View file

@ -56,6 +56,7 @@ struct clc_optional_features {
bool images;
bool images_read_write;
bool images_write_3d;
bool integer_dot_product;
bool intel_subgroups;
bool subgroups;
};

View file

@ -797,6 +797,14 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
"-U__SPIR__",
"-U__SPIRV__",
};
// llvm handles these extensions differently so we have to pass this flag instead to expose the clc functions
if (args->features.integer_dot_product) {
clang_opts.push_back("-Dcl_khr_integer_dot_product=1");
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");
}
// We assume there's appropriate defines for __OPENCL_VERSION__ and __IMAGE_SUPPORT__
// being provided by the caller here.
clang_opts.insert(clang_opts.end(), args->args, args->args + args->num_args);