Skip to content

Commit

Permalink
[openacc] Allow async, wait and device_type on the data construct
Browse files Browse the repository at this point in the history
From OpenACC 3.2 specification:
The async, wait, and device_type clauses may be specified on data
constructs.

This patch adds these clauses in the ACC.td file and adds some tests
for them in flang parsing.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154013
  • Loading branch information
clementval committed Jun 29, 2023
1 parent b881fc2 commit e4f932e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flang/test/Semantics/OpenACC/acc-data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,13 @@ program openacc_data_validity
!ERROR: Unmatched PARALLEL directive
!$acc end parallel

!$acc data copy(aa) async
!$acc end data

!$acc data copy(aa) wait
!$acc end data

!$acc data copy(aa) device_type(1) wait
!$acc end data

end program openacc_data_validity
5 changes: 5 additions & 0 deletions llvm/include/llvm/Frontend/OpenACC/ACC.td
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ def ACC_Atomic : Directive<"atomic"> {}
// 2.6.5
def ACC_Data : Directive<"data"> {
let allowedOnceClauses = [
VersionedClause<ACCC_Async, 32>,
VersionedClause<ACCC_If>,
VersionedClause<ACCC_Default>
];
let allowedClauses = [
VersionedClause<ACCC_DeviceType, 32>,
VersionedClause<ACCC_Wait, 32>
];
let requiredClauses = [
VersionedClause<ACCC_Attach>,
VersionedClause<ACCC_Copy>,
Expand Down

0 comments on commit e4f932e

Please sign in to comment.