Skip to content

Commit 2e389cb

Browse files
authored
[Flang][OpenACC] Make async clause on data consistent with elsewhere (llvm#136866)
in llvm#136610 we agreed that all async clauses on compute constructs should act as 'only 1 per device-type-group'. On `data`, it has the same specification language, and the same real requirements, so it seems sensible to make it work the same way.
1 parent 7915124 commit 2e389cb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ program openacc_data_validity
187187
!$acc data copy(aa) device_type(default) wait
188188
!$acc end data
189189

190+
!ERROR: At most one ASYNC clause can appear on the DATA directive or in group separated by the DEVICE_TYPE clause
191+
!$acc data copy(aa) async(async1) async(2)
192+
!$acc end data
193+
194+
!$acc data copy(aa) async(async1) device_type(multicore) async(2) ! ok
195+
!$acc end data
196+
197+
!ERROR: At most one ASYNC clause can appear on the DATA directive or in group separated by the DEVICE_TYPE clause
198+
!$acc data copy(aa) async(async1) device_type(multicore) async(2) async(3)
199+
!$acc end data
200+
190201
do i = 1, 100
191202
!$acc data copy(aa)
192203
!ERROR: CYCLE to construct outside of DATA construct is not allowed

llvm/include/llvm/Frontend/OpenACC/ACC.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ def ACC_Atomic : Directive<"atomic"> {
284284
// 2.6.5
285285
def ACC_Data : Directive<"data"> {
286286
let allowedOnceClauses = [
287-
VersionedClause<ACCC_Async, 32>,
288287
VersionedClause<ACCC_If>,
289288
VersionedClause<ACCC_Default>
290289
];
291290
let allowedClauses = [
291+
VersionedClause<ACCC_Async, 32>,
292292
VersionedClause<ACCC_DeviceType, 32>,
293293
VersionedClause<ACCC_Wait, 32>
294294
];

0 commit comments

Comments
 (0)