================
@@ -798,6 +798,13 @@ static void InitializePredefinedMacros(const TargetInfo 
&TI,
   Builder.defineMacro("__ATOMIC_ACQ_REL", "4");
   Builder.defineMacro("__ATOMIC_SEQ_CST", "5");
 
+  // Define macros for the clang atomic scopes.
+  Builder.defineMacro("__MEMORY_SCOPE_SYSTEM", "0");
+  Builder.defineMacro("__MEMORY_SCOPE_DEVICE", "1");
+  Builder.defineMacro("__MEMORY_SCOPE_WRKGRP", "2");
+  Builder.defineMacro("__MEMORY_SCOPE_WVFRNT", "3");
+  Builder.defineMacro("__MEMORY_SCOPE_SINGLE", "4");
+
----------------
jhuber6 wrote:

I wasn't keen on tying this to the HIP implementation as it's supposed to be 
more general, but naming is an unsolved problem. Honestly, I think the HIP 
atomics should just be deprecated or make to alias these. The OpenCL ones are 
tied to a language spec and I didn't want to be beholden to that either. I 
wonder if we could make a Sema check to prevent this, they shouldn't be mixed.

https://github.com/llvm/llvm-project/pull/72280
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to