================
@@ -23,4 +23,20 @@
 #define _CLC_DEF __attribute__((always_inline))
 #endif
 
+#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 ||                                  
\
+    (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 &&                                 
\
+     defined(__opencl_c_generic_address_space))
+#define _CLC_GENERIC_AS_SUPPORTED 1
+// Note that we hard-code the assumption that a non-distinct address space 
means
+// that the target maps the generic address space to the private address space.
+#ifdef __CLC_DISTINCT_GENERIC_ADDRSPACE__
+#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 1
+#else
+#define _CLC_DISTINCT_GENERIC_AS_SUPPORTED 0
+#endif
+#else
----------------
frasercrmck wrote:

I've updated the PR. It's mostly to keep it up to date with the changes that 
have landed in clang, so we can remove the CMake logic.

As part of this, CMake now passes in the private and generic address space 
values based on the target via macro defs. The clcfunc.h header now checks for 
equality of the two values before deciding whether the 'distinct' generic 
address space is supported. I haven't changed the names of the macros out of 
simplicity, but also in part because I'd prefer if the check was done once 
centrally so users can rely on a simple `#if/#else` when it comes to 
defining/declaring builtins.

https://github.com/llvm/llvm-project/pull/137183
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to