File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ TYPE_PARSER("AUTO" >> construct<AccClause>(construct<AccClause::Auto>()) ||
111
111
construct<AccClause>(construct<AccClause::Vector>(maybe(
112
112
parenthesized ((" LENGTH:" >> scalarIntExpr || scalarIntExpr))))) ||
113
113
" WAIT" >> construct<AccClause>(construct<AccClause::Wait>(
114
- maybe (Parser<AccWaitArgument>{}))) ||
114
+ maybe (parenthesized( Parser<AccWaitArgument>{}) ))) ||
115
115
" WORKER" >>
116
116
construct<AccClause>(construct<AccClause::Worker>(maybe(
117
117
parenthesized ((" NUM:" >> scalarIntExpr || scalarIntExpr))))) ||
@@ -125,8 +125,10 @@ TYPE_PARSER(construct<AccObjectList>(nonemptyList(Parser<AccObject>{})))
125
125
TYPE_PARSER (construct<AccObjectListWithModifier>(
126
126
maybe (Parser<AccDataModifier>{}), Parser<AccObjectList>{}))
127
127
128
- TYPE_PARSER (construct<AccWaitArgument>(
129
- maybe (" DEVNUM:" >> scalarIntExpr / " :" ), nonemptyList(scalarIntExpr)))
128
+ // 2.16.3 (2485) wait-argument is:
129
+ // [devnum : int-expr :] [queues :] int-expr-list
130
+ TYPE_PARSER (construct<AccWaitArgument>(maybe(" DEVNUM:" >> scalarIntExpr / " :" ),
131
+ " QUEUES:" >> nonemptyList (scalarIntExpr) || nonemptyList(scalarIntExpr)))
130
132
131
133
// 2.9 (1609) size-expr is one of:
132
134
// int-expr
Original file line number Diff line number Diff line change @@ -1937,6 +1937,10 @@ class UnparseVisitor {
1937
1937
Put (" \n " );
1938
1938
EndOpenACC ();
1939
1939
}
1940
+ void Unparse (const AccWaitArgument &x) {
1941
+ Walk (" DEVNUM:" , std::get<std::optional<ScalarIntExpr>>(x.t ), " :" );
1942
+ Walk (std::get<std::list<ScalarIntExpr>>(x.t ), " ," );
1943
+ }
1940
1944
void Unparse (const OpenACCWaitConstruct &x) {
1941
1945
BeginOpenACC ();
1942
1946
Word (" !$ACC " );
Original file line number Diff line number Diff line change @@ -187,6 +187,30 @@ program openacc_clause_validity
187
187
! ERROR: Unmatched END PARALLEL LOOP directive
188
188
! $acc end parallel loop
189
189
190
+ ! $acc kernels wait(1, 2) async(3)
191
+ ! $acc end kernels
192
+
193
+ ! $acc kernels wait(queues: 1, 2) async(3)
194
+ ! $acc end kernels
195
+
196
+ ! $acc kernels wait(devnum: 1: 1, 2) async(3)
197
+ ! $acc end kernels
198
+
199
+ ! $acc kernels wait(devnum: 1: queues: 1, 2) async(3)
200
+ ! $acc end kernels
201
+
202
+ ! $acc wait(1)
203
+ ! $acc wait(1, 2)
204
+
205
+ ! $acc wait(queues: 1)
206
+ ! $acc wait(queues: 1, 2)
207
+
208
+ ! $acc wait(devnum: 1: 3)
209
+ ! $acc wait(devnum: 1: 3, 4)
210
+
211
+ ! $acc wait(devnum: 1: queues: 3)
212
+ ! $acc wait(devnum: 1: queues: 3, 4)
213
+
190
214
contains
191
215
192
216
subroutine sub1 (a )
You can’t perform that action at this time.
0 commit comments