linux-il  

Re: With and Without gcc OMP

Amos Shapira
Tue, 25 Sep 2007 00:37:36 -0700

On 25/09/2007, Nadav Har'El <[EMAIL PROTECTED]> wrote:
>
> On Mon, Sep 24, 2007, Oleg Goldshmidt wrote about "Re: With and Without
> gcc OMP":
> > A #pragma is C code just as any other line in your program, so the
>
> This is what I thought too, so there's something that puzzles me in Orna's
> original description. She said that she tried something like:
>
> #ifdef _OPENMP
> #define OPENMP(line) line
> #else
> #define OPENMP(line) /* nothing */
> #endif
>
> ...
>
> OPENMP(#pragma ...)
>
> But it didn't work for her. Do you have any idea why? In the days when


She also said later that "#if (OPENMP)" worked - I suspect that it's defined
to zero value when it's disabled. Maybe that's the way the compiler
implements this or maybe something in the toolchain (configure?) does this.
I'm sure there is a compiler flag to list the defined macros but can't find
it right now.

--Amos