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

Cesar Philippidis cesar@codesourcery.com
Tue Sep 9 01:25:00 GMT 2014


On 09/07/2014 11:26 PM, Tobias Burnus wrote:

> sorry for the slow review.

No problem. I've been focusing on the subroutine clause lately.

> On 22 August 2014 17:08, Cesar Philippidis wrote:
>>> In OpenMP, one has (OMP 4.0, 2.14.3): "A list item that specifies a
>>> given variable may not appear in more than one clause on the same
>>> directive, except that a variable may be specified in both firstprivate
>>> and lastprivate clauses."
>>> And in 2.14.3.3, OpenMP has: "List items that appear in a private,
>>> firstprivate, or reduction clause in a parallel construct may also
>>> appear in a private clause in an enclosed parallel,task, or worksharing,
>>> or simd construct.
>>>
>>> I tried to find it in something similar in OpenACC - but I failed. I
>>> found in (OpenACC 2.0a, 2.7.11) a reference to reduction with private,
>>> which implies that a reduction variable my be private, but I didn't find
>>> much more. In particular, it is not clear to me whether it would permit
>>> only those which are private implicitly or in an oacc parallel region or
>>> also in an explicit private clause in the same directive. Can you point
>>> me to the spec?
>> I'm not sure. I sent an email to the openacc technical mailing list, but
>> I haven't heard back from them.
> 
> Any new on this?

Not yet, unfortunately.

>> Is this patch ok for gomp-4_0-branch? 
> 
> Looks good to me.
> 
> Tobias
> 
> PS: Looking at
> 
> +  for (n = clauses->lists[OMP_LIST_PRIVATE]; n; n = n->next)
> 
> I was stumbing a bit until I realized that OMP_LIST_PRIVATE is the first
> element. I wonder whether one should have something like OMP_LIST_FIRST
> = OMP_LIST_PRIVATE and OMP_LIST_LAST = OMP_LIST_NUM (or
> OMP_LIST_FIRST_ENUM or ...) which avoids the implicit knowledge which
> comes first in the enum.

That's a good idea. I've made that change in the attached patch and
committed to gomp-4_0-branch.

Thanks,
Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfortran-acc-do-private-d.diff
Type: text/x-patch
Size: 9352 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140909/c7f02179/attachment.bin>


More information about the Gcc-patches mailing list