================
@@ -1460,6 +1460,11 @@ static void InitializePredefinedMacros(const TargetInfo 
&TI,
     }
   }
 
+  // CUDA / HIP offloading only supports OpenMP's CPU support, but both
+  // compilations must define these macros to compile.
+  if (LangOpts.OpenMPMacros)
+    Builder.defineMacro("_OPENMP", "0");
----------------
jhuber6 wrote:

Only device code should be compiled, which shouldn't contain any OpenMP 
pragmas. If you set this to a high value it would make `omp.h` stop working 
because it uses OpenMP  variants to define some functions. I just take this to 
mean that it doesn't exist, but no code on the GPU should be using it anyway. 
This is definitely a hack so I could see complaining to CMake about it instead.

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

Reply via email to