[openacc] acc loop updates in fortran

Jakub Jelinek jakub@redhat.com
Wed Nov 4 17:51:00 GMT 2015


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



More information about the Gcc-patches mailing list