c99 _Pragma operator in OpenMP

Discuss the OpenMP 3.0 API Specifications with the OpenMP Arch. Review Board. (Read Only)

c99 _Pragma operator in OpenMP

Postby PGK » Thu Jan 28, 2010 8:01 am

Hi all,

Is the C99 _Pragma supported by OpenMP? The more common #pragma is first discussed on Page #21:
In C/C++, OpenMP directives are specified by using the #pragma mechanism provided by the C and C++ standards.

Which could imply that a compliant OpenMP c99 compiler would translate something like:
Code: Select all
_Pragma("omp parallel for")

Code: Select all
#pragma omp parallel for

and so be compliant.

As well as being an operator, it can appear as a result of macro expansion; e.g.
Code: Select all
#define PARFOR _Pragma("omp parallel for")

In any case, I only have gcc, which does appear to support the use of _Pragma like this for OpenMP. Is this well supported? Do other C99 compilers also support _Pragma?

Posts: 5
Joined: Thu Jan 28, 2010 7:38 am

Re: c99 _Pragma operator in OpenMP

Postby Federico » Tue Feb 02, 2010 7:01 am

TO my understanding, independently of OpenMP, a C99 compiler must support both forms, the #pragma directive and the _Pragma unary operator. Thus, it seems to be a matter of C99 compliance of each compiler. You should check with compiler vendor or developer organization. Documentation is available online for most compilers.

Posts: 22
Joined: Wed Oct 24, 2007 6:39 am

Return to OpenMP 3.0 API Specifications

Who is online

Users browsing this forum: No registered users and 1 guest