This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Allow multiple wait clauses
ClosedPublic

Authored by clementval on Jan 26 2021, 12:17 PM.

Details

Summary

kernels loop and enter data had a too restrictive constraint for the wait clause.
The wait clause is allowed multiple times and not only once. This patch fix this problem.

Diff Detail

Event Timeline

clementval requested review of this revision.Jan 26 2021, 12:17 PM
clementval created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2021, 12:17 PM
clementval added a project: Restricted Project.Jan 26 2021, 12:46 PM
SouraVX added inline comments.Jan 26 2021, 8:45 PM
flang/test/Semantics/OpenACC/acc-data.f90
62

Looking at it, I assume wait1 is an event of some kind ? That data create directive is waiting for finishing ?
Then again where is wait1 defined ?
Could you point me to the spec WRT this clause.

flang/test/Semantics/OpenACC/acc-data.f90
62

Spec: https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.1-final.pdf

In Section 2.16.2 it says "If there is an argument to the wait clause, it must be a wait argument (See 2.16.3)."

Section 2.16.3/Page 80

The wait argument, if it appears, must be a wait-argument where wait-argument is:
[ devnum : int-expr : ] [ queues : ] int-expr-list
clementval added inline comments.Jan 27 2021, 7:05 AM
flang/test/Semantics/OpenACC/acc-data.f90
62

The @kiranchandramohan for mentioning the spec. Basically the most basic wait argument is just a int-expr. You can see it as a stream number in CUDA.

SouraVX accepted this revision.Jan 27 2021, 7:40 AM

LGTM!

flang/test/Semantics/OpenACC/acc-data.f90
62

Thanks for the stream number analogy :)

This revision is now accepted and ready to land.Jan 27 2021, 7:40 AM
clementval marked 3 inline comments as done.Jan 27 2021, 10:18 AM

LGTM!

Thanks for all the reviews! Greatly appreciated!

This revision was landed with ongoing or failed builds.Jan 27 2021, 10:18 AM
This revision was automatically updated to reflect the committed changes.