[patch,gomp4] make fortran loop variables implicitly private in openacc

Cesar Philippidis cesar_philippidis@mentor.com
Wed Aug 13 03:55:00 GMT 2014


On 08/11/2014 04:55 PM, Cesar Philippidis wrote:
> According to section 2.6.1 in the openacc spec, fortran loop variables
> should be implicitly private like in openmp. This patch does just so.
> Also, while working on this patch, I noticed that I made the check for
> variables appearing in multiple openacc clauses too strict. A private
> variable may also appear inside a reduction clause. I've also included a
> fix for this in this patch.
> 
> Is this OK for gomp-4_0-branch?

I've updated this patch to properly handle loop nests inside openacc
data blocks. In the original patch, something like this

!$acc data copy(A)
  do z = 1, 100

!$acc parallel
!$acc loop
    do j=1,m-2

    end do
!$acc end parallel

  end do

would result in the loop variable 'z' being implicitly treated as
private. This occurs because gfc_resolve_oacc_blocks updates
oacc_current_ctx for both loop and data blocks. Originally
omp_current_ctx was only associated with do blocks, so
gfc_resolve_do_iterator didn't expect non-loop ctx's. This revised patch
makes gfc_resolve_do_iterator aware potential data blocks.

Is this OK for gomp-4_0-branch?

Thanks,
Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfortran-acc-do-private-b.diff
Type: text/x-patch
Size: 5771 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140813/6e55c192/attachment.bin>


More information about the Fortran mailing list