[flang-commits] [flang] e4f932e - [openacc] Allow async, wait and device_type on the data construct

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Thu Jun 29 09:45:52 PDT 2023


Author: Valentin Clement
Date: 2023-06-29T09:45:46-07:00
New Revision: e4f932e5ed716e754f728d250e7fb2e46419f338

URL: https://github.com/llvm/llvm-project/commit/e4f932e5ed716e754f728d250e7fb2e46419f338
DIFF: https://github.com/llvm/llvm-project/commit/e4f932e5ed716e754f728d250e7fb2e46419f338.diff

LOG: [openacc] Allow async, wait and device_type on the data construct

>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

Added: 
    

Modified: 
    flang/test/Semantics/OpenACC/acc-data.f90
    llvm/include/llvm/Frontend/OpenACC/ACC.td

Removed: 
    


################################################################################
diff  --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90
index e51579ebb21c96..de168ba70d19b9 100644
--- a/flang/test/Semantics/OpenACC/acc-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-data.f90
@@ -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

diff  --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index 98cf49f03a49d9..54d9950263201f 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -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>,


        


More information about the flang-commits mailing list