mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-14 11:28:19 +02:00
clc: support some atomic and generic address space features
Cc: mesa-stable Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39374>
This commit is contained in:
parent
7f9a7ed553
commit
01e1392139
2 changed files with 12 additions and 0 deletions
|
|
@ -50,9 +50,12 @@ enum clc_spirv_version {
|
|||
};
|
||||
|
||||
struct clc_optional_features {
|
||||
bool atomic_order_seq_cst;
|
||||
bool atomic_scope_device;
|
||||
bool extended_bit_ops;
|
||||
bool fp16;
|
||||
bool fp64;
|
||||
bool generic_address_space;
|
||||
bool int64;
|
||||
bool images;
|
||||
bool images_depth;
|
||||
|
|
|
|||
|
|
@ -963,6 +963,12 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
|
|||
c->getPreprocessorOpts().addMacroDef("cl_khr_expect_assume=1");
|
||||
|
||||
bool needs_opencl_c_h = false;
|
||||
if (args->features.atomic_order_seq_cst) {
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_atomic_order_seq_cst");
|
||||
}
|
||||
if (args->features.atomic_scope_device) {
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_atomic_scope_device");
|
||||
}
|
||||
if (args->features.extended_bit_ops) {
|
||||
c->getPreprocessorOpts().addMacroDef("cl_khr_extended_bit_ops=1");
|
||||
}
|
||||
|
|
@ -973,6 +979,9 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
|
|||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_fp64");
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_fp64");
|
||||
}
|
||||
if (args->features.generic_address_space) {
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_generic_address_space");
|
||||
}
|
||||
if (args->features.int64) {
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cles_khr_int64");
|
||||
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_int64");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue