This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [openacc] acc loop updates in fortran
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Cesar Philippidis <cesar at codesourcery dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Nov 2015 18:51:08 +0100
- Subject: Re: [openacc] acc loop updates in fortran
- Authentication-results: sourceware.org; auth=none
- References: <5639764A dot 2000209 at codesourcery dot com> <87ziytznx9 dot fsf at kepler dot schwinge dot homeip dot net> <563A42E6 dot 3020301 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 04, 2015 at 09:39:50AM -0800, Cesar Philippidis wrote:
> On 11/04/2015 09:15 AM, Thomas Schwinge wrote:
>
> >> --- a/gcc/fortran/trans-openmp.c
> >> +++ b/gcc/fortran/trans-openmp.c
> >
> >> @@ -3449,16 +3478,28 @@ gfc_trans_oacc_combined_directive (gfc_code *code)
> >> sizeof (construct_clauses));
> >> loop_clauses.collapse = construct_clauses.collapse;
> >> [...]
> >> - construct_clauses.collapse = 0;
> >
> > Again I'm confused by this, why this is being removed, as earlier in
> > <http://news.gmane.org/find-root.php?message_id=%3C87vb9r45qw.fsf%40kepler.schwinge.homeip.net%3E>.
>
> I'm not sure why, but gfc_trans_omp_do needs it. It's probably an openmp
> thing. If you look at gfc_trans_omp_do, you'll see that two sets of
> clauses are passed into it. code->ext.omp_clauses corresponds to the
> combined construct clauses and do_clauses are the filtered out ones.
>
> So in order to get collapse to work as expected in combined loops, I
> can't zero out construct_clauses.collapse.
The middle end requires that for composite constructs (i.e. where one
source collapsed loop is split among multiple levels of parallelism)
all those loop constructs contain the same collapse clause, and that all
but the innermost loop construct contain NULLs on the init/cond/step etc.
vectors.
Jakub