Hi Thomas,

first, can you add an entry regarding this flag
to https://gcc.gnu.org/gcc-12/changes.html ?

Secondly, I now see FAILs like:

FAIL: gfortran.dg/goacc/classify-serial.f95   -O  (test for excess errors)
Excess errors:
gfortran.dg/goacc/classify-serial.f95:20:132: Warning: region contains gang 
partitioned code but is not gang partitioned [-Wopenacc-parallelism]
gfortran.dg/goacc/classify-serial.f95:20:132: Warning: region contains vector 
partitioned code but is not vector partitioned [-Wopenacc-parallelism]

FAIL: gfortran.dg/goacc/kernels-decompose-2.f95   -O  (test for excess errors)
Excess errors:
gfortran.dg/goacc/kernels-decompose-2.f95:124:15: Warning: region contains gang 
partitioned code but is not gang partitioned [-Wopenacc-parallelism]

FAIL: gfortran.dg/goacc/routine-module-mod-1.f90 (test for excess errors)
Excess errors:
gfortran.dg/goacc/routine-module-mod-1.f90:56:16: Warning: region is worker 
partitioned but does not contain worker partitioned code [-Wopenacc-parallelism]

Tobias

On 26.04.21 12:39, Thomas Schwinge wrote:

Hi!

On 2021-02-26T04:21:54-0800, Julian Brown <jul...@codesourcery.com> wrote:
This patch adds warnings for strange partitioning choices -- specifying
either more or fewer partitioning levels on a parallel directive than the
enclosed offload region actually uses.
Thanks!

We've used a version of this patch on the og8/og9/og10 branches for
quite a while.  Versions have been posted for mainline submission as
part of a larger patch several times, e.g. here:

   https://gcc.gnu.org/pipermail/gcc-patches/2018-October/507938.html

One motivation for committing this patch is it removes an ongoing
divergence in a large number of test cases between the og* branches and
mainline, namely whether the added warnings are expected as a result of
compiling those test cases, or not.

The warnings themselves are perhaps slightly aggressive, but are intended
to help the user write more efficient code.
As I'd said in
<http://mid.mail-archive.com/87zhoefcpf.fsf@euler.schwinge.homeip.net>:

| The general intention is good, but I've seen cases where I considered
| these diagnostics to be too noisy.  See also the several 'dg-bogus'
| with XFAIL

... as well as 'dg-additional-options "-w"' being added.

I've spent some more time on this; in particular, 'dg-bogus' with XFAIL
setup, to indicate individual items that I think need to be addressed.
(Please let me know if anybody makes a different categorization regarding
these.)  Of course, not all of our testcases are representative of
real-world code (but I've anyway removed '-w' in favor of 'dg-warning' or
'dg-bogus' with XFAIL, for coverage), but I still came to the conclusion
that this is too noisy to enable by default (as had been proposed), and
thus for the time being have hidden it behind '-Wopenacc-parallelism'.
(Adding an option is good anyway, so that users are able to disable
unwanted diagnostics; we need to do that for other OpenACC diagnostics,
too.)  The goal is to eventually enable '-Wopenacc-parallelism', with
'-Wall' and some "special cases" with '-Wextra', I suppose.

I've pushed "Add '-Wopenacc-parallelism'" to master branch in commit
22cff118f7526bec195ed6e41452980820fdf3a8, see attached.


Grüße
  Thomas


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München 
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank 
Thürauf

Reply via email to