Preprocessor macro identifying PGI

This is probably a FAQ, but I was wondering if there was a builtin preprocessor macro (like _ACCEL or _CUDA) that says “I’m compiling with PGI”.

I ask because in some code I have, there are sometimes segments that PGI doesn’t like and, while I’m trying to get it fixed, it’d be convenient to have use of an “#ifdef _USING_PGI” or the like as a temporary workaround.


Hi Matt,

Use “__PGI” (two under bars followed by PGI) . All PGI compilers implicitly define this macro.

  • Mat

Ahhh, thanks. I knew it had to be something like that, but my guesses were all off (i.e., I used one underscore).