diff --git a/src/compiler/clc/clc.h b/src/compiler/clc/clc.h index c5c3a2b1c18..d5447306fd4 100644 --- a/src/compiler/clc/clc.h +++ b/src/compiler/clc/clc.h @@ -50,11 +50,14 @@ enum clc_spirv_version { }; struct clc_optional_features { + bool fp16; bool fp64; bool int64; bool images; bool images_read_write; bool images_write_3d; + bool intel_subgroups; + bool subgroups; }; struct clc_compile_args { diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index caee1fd81f7..4451c371933 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -871,6 +871,9 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_global_int32_extended_atomics"); c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_local_int32_base_atomics"); c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_local_int32_extended_atomics"); + if (args->features.fp16) { + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_fp16"); + } if (args->features.fp64) { c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_fp64"); c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_fp64"); @@ -889,6 +892,12 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_3d_image_writes"); c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_3d_image_writes"); } + if (args->features.intel_subgroups) { + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_intel_subgroups"); + } + if (args->features.subgroups) { + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_subgroups"); + } #endif if (args->num_headers) {