OpenACC wait clause
Cesar Philippidis
cesar@codesourcery.com
Fri Jun 17 03:22:00 GMT 2016
On 06/07/2016 08:02 AM, Jakub Jelinek wrote:
> On Tue, Jun 07, 2016 at 08:01:10AM -0700, Cesar Philippidis wrote:
>> On 06/07/2016 04:13 AM, Jakub Jelinek wrote:
>>
>>> I've noticed
>>> if ((mask & OMP_CLAUSE_WAIT)
>>> && !c->wait
>>> && gfc_match ("wait") == MATCH_YES)
>>> {
>>> c->wait = true;
>>> match_oacc_expr_list (" (", &c->wait_list, false);
>>> continue;
>>> }
>>> which looks just weird and confusing. Why isn't this instead:
>>> if ((mask & OMP_CLAUSE_WAIT)
>>> && !c->wait
>>> && (match_oacc_expr_list ("wait (", &c->wait_list, false)
>>> == MATCH_YES))
>>> {
>>> c->wait = true;
>>> continue;
>>> }
>>> ? Otherwise you happily accept wait without following (, perhaps even
>>> combined with another clause without any space in between etc.
>>
>> Both acc wait and async accept optional parenthesis arguments. E.g.,
>>
>> #pragma acc wait
>>
>> blocks for all of the async streams to complete before proceeding, whereas
>>
>> #pragma acc wait (1, 5)
>>
>> only blocks for async streams 1 and 5.
>
> But then you need to set need_space = true; if it doesn't have the ( after
> it.
I was distracted with acc routine stuff, so this took me a little longer
to get around to this. In addition to that problem with the wait clause,
I discovered a similar problem with the async clause and the wait
directive. It this patch ok for trunk and gcc-6?
Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fortran-wait-async.diff
Type: text/x-patch
Size: 3287 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160617/b20faeb6/attachment.bin>
More information about the Gcc-patches
mailing list