[PATCH] D86325: [flang][openacc] Fix wait-argument for wait clause + add tests
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 23 17:01:38 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG86bbf8e6fc2b: [flang][openacc] Fix wait-argument for wait clause + add tests (authored by clementval).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86325/new/
https://reviews.llvm.org/D86325
Files:
flang/lib/Parser/openacc-parsers.cpp
flang/lib/Parser/unparse.cpp
flang/test/Semantics/acc-clause-validity.f90
Index: flang/test/Semantics/acc-clause-validity.f90
===================================================================
--- flang/test/Semantics/acc-clause-validity.f90
+++ flang/test/Semantics/acc-clause-validity.f90
@@ -187,6 +187,30 @@
!ERROR: Unmatched END PARALLEL LOOP directive
!$acc end parallel loop
+ !$acc kernels wait(1, 2) async(3)
+ !$acc end kernels
+
+ !$acc kernels wait(queues: 1, 2) async(3)
+ !$acc end kernels
+
+ !$acc kernels wait(devnum: 1: 1, 2) async(3)
+ !$acc end kernels
+
+ !$acc kernels wait(devnum: 1: queues: 1, 2) async(3)
+ !$acc end kernels
+
+ !$acc wait(1)
+ !$acc wait(1, 2)
+
+ !$acc wait(queues: 1)
+ !$acc wait(queues: 1, 2)
+
+ !$acc wait(devnum: 1: 3)
+ !$acc wait(devnum: 1: 3, 4)
+
+ !$acc wait(devnum: 1: queues: 3)
+ !$acc wait(devnum: 1: queues: 3, 4)
+
contains
subroutine sub1(a)
Index: flang/lib/Parser/unparse.cpp
===================================================================
--- flang/lib/Parser/unparse.cpp
+++ flang/lib/Parser/unparse.cpp
@@ -1937,6 +1937,10 @@
Put("\n");
EndOpenACC();
}
+ void Unparse(const AccWaitArgument &x) {
+ Walk("DEVNUM:", std::get<std::optional<ScalarIntExpr>>(x.t), ":");
+ Walk(std::get<std::list<ScalarIntExpr>>(x.t), ",");
+ }
void Unparse(const OpenACCWaitConstruct &x) {
BeginOpenACC();
Word("!$ACC ");
Index: flang/lib/Parser/openacc-parsers.cpp
===================================================================
--- flang/lib/Parser/openacc-parsers.cpp
+++ flang/lib/Parser/openacc-parsers.cpp
@@ -111,7 +111,7 @@
construct<AccClause>(construct<AccClause::Vector>(maybe(
parenthesized(("LENGTH:" >> scalarIntExpr || scalarIntExpr))))) ||
"WAIT" >> construct<AccClause>(construct<AccClause::Wait>(
- maybe(Parser<AccWaitArgument>{}))) ||
+ maybe(parenthesized(Parser<AccWaitArgument>{})))) ||
"WORKER" >>
construct<AccClause>(construct<AccClause::Worker>(maybe(
parenthesized(("NUM:" >> scalarIntExpr || scalarIntExpr))))) ||
@@ -125,8 +125,10 @@
TYPE_PARSER(construct<AccObjectListWithModifier>(
maybe(Parser<AccDataModifier>{}), Parser<AccObjectList>{}))
-TYPE_PARSER(construct<AccWaitArgument>(
- maybe("DEVNUM:" >> scalarIntExpr / ":"), nonemptyList(scalarIntExpr)))
+// 2.16.3 (2485) wait-argument is:
+// [devnum : int-expr :] [queues :] int-expr-list
+TYPE_PARSER(construct<AccWaitArgument>(maybe("DEVNUM:" >> scalarIntExpr / ":"),
+ "QUEUES:" >> nonemptyList(scalarIntExpr) || nonemptyList(scalarIntExpr)))
// 2.9 (1609) size-expr is one of:
// int-expr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86325.287277.patch
Type: text/x-patch
Size: 2636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/2797da5d/attachment.bin>
More information about the llvm-commits
mailing list