[PATCH, PR70895] Add copy mapping for reductions on OpenACC loop directives

Jakub Jelinek jakub@redhat.com
Mon Aug 15 13:23:00 GMT 2016


On Mon, Aug 15, 2016 at 07:25:48PM +0800, Chung-Lin Tang wrote:
> per the discussion on the bugzilla PR page, reductions on OpenACC loop
> directives will automatically get a copy clause mapping on an enclosing
> parallel construct (unless bounded by a local variable or an explicit
> firstprivate clause).
> 
> There is also a patch for libgomp testsuite cases. Asides from the
> fortran case which now needs explicit firstprivate clauses to work,
> other C/C++ cases have been adjusted to remove explicit copy clauses.
> (I have not exhaustively searched everywhere to eliminate them though)
> 
> This has been tested using gomp-4_0-branch, which is based on GCC 6,
> which is what this PR was originally filed for.
> 
> I will be committing this soon for gomp-4_0-branch,
> is this okay for gcc-6-branch and trunk as well?

The gimplify.c change is ok for trunk and 6.3 (after 6.2 is released).
As for the testsuite, I'll leave it to Thomas/Nathan on what they prefer,
I'd think that having explicit clauses in e.g. half of the testcases and
implicit ones in the other half wouldn't hurt, so that both are tested
enough.

> 2016-08-15  Chung-Lin Tang  <cltang@codesourcery.com>
> 
>         PR middle-end/70895
>         gcc/
>         * gimplify.c (omp_add_variable): Adjust/add variable mapping on
>         enclosing parallel construct for reduction variables on OpenACC loop
>         directives.
> 
>         libgomp/
>         * testsuite/libgomp.oacc-fortran/reduction-7.f90: Add explicit
>         firstprivate clauses.
>         * testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Remove explicit
>         copy clauses.
>         * testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/reduction-flt.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/collapse-4.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
>         * testsuite/libgomp.oacc-c-c++-common/reduction-dbl.c: Likewise.

	Jakub



More information about the Gcc-patches mailing list