When browsing libgomp doc, I came across https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html
First, I found especially the Fortran part difficult to read. Secondly, it missed the C++ attribute syntax. And I also missed a reference to -fopenmp-simd. The attached patch tries to improve this. Note that it talks about C and C++ attributes, even though C23's [[omp::]] support has not yet landed. (But is expected very soon.) I also do not try to list what -fopenmp-simd supports as that's at https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-fopenmp and I bet we won't keep both in sync and "man gcc" is more likely to be up to date. Comments? 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
libgomp.texi: Update "Enabling OpenMP" libgomp/ * libgomp.texi (Enabling OpenMP): Update for C/C++ attributes; improve wording especially for Fortran; mention -fopenmp-simd. diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index 526d1be2955..d8126f96fe4 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -136,15 +136,22 @@ changed to GNU Offloading and Multi Processing Runtime Library. @node Enabling OpenMP @chapter Enabling OpenMP -To activate the OpenMP extensions for C/C++ and Fortran, the compile-time -flag @command{-fopenmp} must be specified. This enables the OpenMP directive -@code{#pragma omp} in C/C++ and @code{!$omp} directives in free form, -@code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form, -@code{!$} conditional compilation sentinels in free form and @code{c$}, -@code{*$} and @code{!$} sentinels in fixed form, for Fortran. The flag also -arranges for automatic linking of the OpenMP runtime library +To activate the OpenMP extensions for C/C++ and Fortran, the compile-time +flag @command{-fopenmp} must be specified. For C and C++, this enables +the handling of the OpenMP directives using @code{#pragma omp} and the +@code{[[omp::directive(...)]]}, @code{[[omp::sequence(...)]]} and +@code{[[omp::decl(...)]]} attributes. For Fortran, it enables for +free source form the @code{!$omp} sentinel for directives and the +@code{!$} conditional compilation sentinel and for fixed source form the +@code{c$omp}, @code{*$omp} and @code{!$omp} sentinels for directives and +the @code{c$}, @code{*$} and @code{!$} conditional compilation sentinels. +The flag also arranges for automatic linking of the OpenMP runtime library (@ref{Runtime Library Routines}). +The @command{-fopenmp-simd} flag can be used to enable a subset of +OpenMP directives, which do not require the linking of neither the +OpenMP runtime library nor the POSIX threads library. + A complete description of all OpenMP directives may be found in the @uref{https://www.openmp.org, OpenMP Application Program Interface} manuals. See also @ref{OpenMP Implementation Status}.