diff --git a/src/compiler/clc/clc.h b/src/compiler/clc/clc.h index 71a763b49c4..690c3db0a45 100644 --- a/src/compiler/clc/clc.h +++ b/src/compiler/clc/clc.h @@ -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; }; diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 6a36b5c8ec6..37d65e8c9b2 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -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);