[clang] [HIP] Define `_OPENMP` on the device for mixed OpenMP CPU compilations (PR #176791)

Ye Luo via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 25 11:58:09 PST 2026


ye-luo wrote:

> > If possible, it will better asking users fixing their cmake rather than complicating hip mode.
> 
> The OpenMP standard says that if `-fopenmp` is passes `_OPENMP` is defined. It's an easy fix if you know what you're doing but I'm unsure if we should be violating this, it's not just this test though it's the relevant bit.

I won't consider a hip compiler or clang in hip mode as a valid OpenMP compiler hence doesn't need to follow OpenMP spec.

https://github.com/llvm/llvm-project/pull/176791


More information about the cfe-commits mailing list