Hi,

On 01.12.21 19:35, Martin Jambor wrote:
On Tue, Nov 30 2021, Mohamed Atef wrote:
Where is the variable of the OpenMP version defined?

The GCC code itself does not make a difference, contrary to
C/C++/Fortran which have -std=....

OpenMP 4.5 (also known as 201511) is fully supported (minus bugs). Thus,
that's the version number (201511) reported to the user. For Fortran,
the 'openmp_version' parameter in the module 'omp_lib' and in omp_lib.h
come from libgomp/omp_lib.f90.in and libgomp/omp_lib.h.in. For C/C++ (or
Fortran with -cpp for the preprocessor), the value is in _OPENMP and is
defined in gcc/c-family/c-cppbuiltin.c.

However, while GCC only claims 4.5/201511 support, OpenMP 5.0 and 5.1
are partially implemented, cf.
https://gcc.gnu.org/onlinedocs/libgomp/OpenMP-Implementation-Status.html

Thus, when a later version of the spec changed behavior, GCC might not
have 4.5 semantic but 5.0, 5.1 or even 5.2 (or later) semantic. This
happens either when implementing a 5.x feature or when a bug in the spec
was found which has then be fixed.

For completeness, for exported symbols in libgomp, some versioning
exists, cf. libgomp/libgomp.map.

Thanks for working on OMPD!

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to