[clang] a5cf17f - [OpenCL] Expose wg collective functions for CL3 SPIR targets
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Mon May 30 02:48:57 PDT 2022
Author: Sven van Haastregt
Date: 2022-05-30T10:48:49+01:00
New Revision: a5cf17f8ae752f1b62b40b907bfee4faa3600b21
URL: https://github.com/llvm/llvm-project/commit/a5cf17f8ae752f1b62b40b907bfee4faa3600b21
DIFF: https://github.com/llvm/llvm-project/commit/a5cf17f8ae752f1b62b40b907bfee4faa3600b21.diff
LOG: [OpenCL] Expose wg collective functions for CL3 SPIR targets
Since the SPIR/SPIR-V targets enable all known features, we must
ensure the Work-group Collective Functions feature macro is set for
OpenCL 3.0.
Fixes https://github.com/llvm/llvm-project/issues/55770
Added:
Modified:
clang/lib/Headers/opencl-c-base.h
Removed:
################################################################################
diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
index 20048d97bc74..c433b4f7eb1a 100644
--- a/clang/lib/Headers/opencl-c-base.h
+++ b/clang/lib/Headers/opencl-c-base.h
@@ -68,6 +68,7 @@
#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
// For the SPIR and SPIR-V target all features are supported.
#if defined(__SPIR__) || defined(__SPIRV__)
+#define __opencl_c_work_group_collective_functions 1
#define __opencl_c_atomic_order_seq_cst 1
#define __opencl_c_atomic_scope_device 1
#define __opencl_c_atomic_scope_all_devices 1
More information about the cfe-commits
mailing list