public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/108749] New: [OpenMP][C/C++/Fortran] inscan reduction modifier rejected for combined/composite constructs of simd/for/do
@ 2023-02-10 10:11 burnus at gcc dot gnu.org
  2023-02-10 10:18 ` [Bug other/108749] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-02-10 10:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108749

            Bug ID: 108749
           Summary: [OpenMP][C/C++/Fortran] inscan reduction modifier
                    rejected for combined/composite constructs of
                    simd/for/do
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: openmp, rejects-valid
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

This applies to C, C++ and Fortran likewise.

test.c:6:37: error: ‘inscan’ ‘reduction’ clause on construct other than ‘for’,
‘simd’, ‘for simd’, ‘parallel for’, ‘parallel for simd’

    6 |   #pragma omp target simd reduction (inscan, *:r)
      |                                     ^


OpenMP 5.0 had the following:

"A reduction clause with the *inscan* reduction-modifier may only appear on a
worksharing-loop construct, a worksharing-loop SIMD construct, a simd
construct, a parallel worksharing-loop construct or a parallel worksharing-loop
SIMD construct."

But, a bit confusingly, it also had:

"If a construct to which the *inscan* reduction-modifier is
applied is combined with the *target* construct, the effect is as if the same
list item also appears in a map clause with a map-type of tofrom."

The latter implying that a combined construct is also permitted - while the
former rules it out.

 * * *

OpenMP 5.1 seemingly fixed this while 5.2 removed constructs with 'distribute'.
In any case, OpenMP 5.2 reads as follows:

"A reduction clause with the *inscan* reduction-modifier may only appear on a
worksharing-loop construct, a simd construct or a combined or composite
construct for which any of the aforementioned constructs is a constituent
construct and distribute is not a constituent construct." — ["5.5.8 reduction
Clause" under "Restrictions to the reduction clause are as follows:" (7th
bullet), [136:1-4]]

 * * *

I think this currently implies that the following ones should be supported
besides the exsisting '(parallel) {do|for} (simd)' and 'simd'.

OMP_MASKED_TASKLOOP_SIMD
OMP_MASTER_TASKLOOP_SIMD
OMP_PARALLEL_MASKED_TASKLOOP_SIMD
OMP_PARALLEL_MASTER_TASKLOOP_SIMD
OMP_TARGET_PARALLEL_DO
OMP_TARGET_PARALLEL_DO_SIMD
OMP_TARGET_SIMD
OMP_TASKLOOP_SIMD

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-10 11:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 10:11 [Bug other/108749] New: [OpenMP][C/C++/Fortran] inscan reduction modifier rejected for combined/composite constructs of simd/for/do burnus at gcc dot gnu.org
2023-02-10 10:18 ` [Bug other/108749] " jakub at gcc dot gnu.org
2023-02-10 10:27 ` jakub at gcc dot gnu.org
2023-02-10 11:00 ` burnus at gcc dot gnu.org
2023-02-10 11:11 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).