Re: [patch] libgomp.texi: Update "Enabling OpenMP" + OpenACC / invoke.texi: -fopenacc/-fopenmp update (was: Re: [patch] libgomp.texi: Update "Enabling OpenMP")

2023-10-15 Thread Sandra Loosemore

On 10/15/23 04:42, Tobias Burnus wrote:


Updated patch attached.


This version looks OK to me.

-Sandra


[patch] libgomp.texi: Update "Enabling OpenMP" + OpenACC / invoke.texi: -fopenacc/-fopenmp update (was: Re: [patch] libgomp.texi: Update "Enabling OpenMP")

2023-10-15 Thread Tobias Burnus

Hi Sandra and Jakub,

I have now updated the patch; on the way, I found an issue in -fopenacc ('!$' is
not OpenACC and no longer supported) and the same @code/@samp.

I also updated invoke.texi for the same @code/@samp - and added both '!$'
and mentioned the 'c$'/'*$' Fortran fixed-form variant. I think the most
important bit is that '!$' is also supported by -fopenmp-simd as that's not
covered by the OpenMP specification.

Otherwise:

On 14.10.23 23:46, Sandra Loosemore wrote:

On 10/14/23 13:43, Tobias Burnus wrote:

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.)


Is somebody actively working on implementing that, and expecting to
get it in before Stage 1 closes?  I don't think we should document
features that don't exist yet.

Yes. But I have now sneaked in an 'in C++' which can also be easily
removed once Jakub's patch is committed or as part of Jakub's patch.

This syntax for C also isn't even in the draft OpenMP 6.0 document so
at this point


Well, it is in the git version, which will be released as TR12 in about
a month (in time for SC23). It is very unlikely to get removed before
OpenMP 6.0 as it is an obvious extension to C++11's attribute support,
now that C supports attributes as well.


Other than that...
Use @option markup on options, not @command.


Fixed. Was preexisting and I copied it once. I've now checked, the only
other use in libgomp.texi was for an actual command (nvprof).



And I think all those @code markups should be @samp instead, or you
could just replace this whole blurb with something like "This flag
enables recognition of the directive syntax documented in the OpenMP
specification, and also arranges for automatic linking..."


I think it is more user friendly to document the sentinels. However, I
concur that @samp is better.


+OpenMP directives, which do not require the linking of neither the

s/, which/ that/


I have now used it, but I think it sound odd:

"enables *a* subset of OpenMP directives *that* do not require the linking"

I concur that with "*the* subset ... *that*" makes sense but I want to
avoid stating that *all* directives that do not require linking of
libgomp/libpthread are supported.

invoke.texi lists all supported directives, but I am not really fond of
repeating that list.


s/neither/either/


The fun of whether double negation cancels or enforces the negation or
.. ("not .. neither / nor").

Cf. https://en.wikipedia.org/wiki/Double_negative

In German and English, both cancellation and enforcement seem to be
possible, the latter especially with dialects - while the standard
language tends to avoid double negation.

Updated patch attached.

Thanks,

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" + OpenACC / invoke.texi: -fopenacc/-fopenmp update

The OpenACC specification does not mention the '!$ ' sentinel for conditional
compilation and the feature was removed in r11-5572-g1d6f6ac693a860
for PR fortran/98011.

libgomp/
	* libgomp.texi (Enabling OpenMP): Update for C/C++ attributes;
	improve wording especially for Fortran; mention -fopenmp-simd.
	(Enabling OpenACC): Minor cleanup; remove conditional compilation
	sentinel.

gcc/
	* doc/invoke.texi (-fopenacc, -fopenmp, -fopenmp-simd): Use @samp not
	@code; document more completely the supported Fortran sentinels.

gcc/fortran
	* scanner.cc (skip_free_comments, skip_fixed_comments): Remove
	leftover 'OpenACC' from comments about OpenMP's conditional
	compilation sentinel.

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index fee659462ff..eb714d18511 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2748,9 +2748,10 @@ Typical command lines are
 @opindex fopenacc
 @cindex OpenACC accelerator programming
 @item -fopenacc
-Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
-@code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
-compiler generates accelerated code according to the OpenACC Application
+Enable handling of OpenACC directives @samp{#pragma acc} in C/C++ and
+@samp{!$acc} in free-form Fortran and @samp{!$acc}, @samp{c$acc} and
+@samp{*$acc} in fixed-form Fortran.  When @option{-fopenacc} is specified,
+the compiler generates accelerated code according to the OpenACC Application
 Programming Interface v2.6 @w{@uref{https://www.openacc.org}}.  This option
 implies @option{-pthread}, and thus is only supported on targets that
 have support for @option{-pthread}.
@@ -2766,10 +2767,12 @@ can be omitted, to use a target-specific default value.
 @opindex fopenmp
 @cindex OpenMP parallel
 @item -fopenmp
-Enable handling of OpenMP directives @code{#pragma omp} in