https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103988
Bug ID: 103988
Summary: [OpenACC][2.7] Support array vars in reductions
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: openacc
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
Target Milestone: ---
Created attachment 52168
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52168&action=edit
Fortran testcase from Mikel Mendizabal's email report
Reported at https://gcc.gnu.org/pipermail/gcc/2022-January/238094.html
GCC currently only supports scalars in OpenACC reduction clauses.
(That matches OpenACC 2.6, which is supported since GCC 10.)
Expected: Support arrays as reduction variables as specified since OpenACC 2.7.
OpenACC 2.7 has the following (at a glance, OpenACC 3.2's wording is the same):
"If the reduction var is an array or subarray, the array reduction operation is
logically equivalent to applying that reduction operation to each element of
the array or subarray individually.
If the reduction var is a composite variable, the reduction operation is
logically equivalent to applying that reduction operation to each member of the
composite variable individually."
(+ some restrictions and some notes about the supported data types)
I note that GCC's OpenMP implementation supports arrays and array sections
(array sections not yet for the Fortran FE). Thus, the array part should be
relatively simple. (The composite-variable feature is OpenACC only.)