[PATCH] D95469: [flang][openacc] Allow multiple wait clauses

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 12:17:42 PST 2021


clementval created this revision.
clementval added reviewers: kiranchandramohan, SouraVX, kiranktp, sameeranjoshi.
clementval requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

kernels loop and enter data had a too restrictive constraint for the wait clause.
The wait clause is allowed multiple times and not only once. This patch fix this problem.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95469

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


Index: llvm/include/llvm/Frontend/OpenACC/ACC.td
===================================================================
--- llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -477,10 +477,12 @@
 
 // 2.14.6
 def ACC_EnterData : Directive<"enter data"> {
+  let allowedClauses = [
+    VersionedClause<ACCC_Wait>
+  ];
   let allowedOnceClauses = [
     VersionedClause<ACCC_Async>,
-    VersionedClause<ACCC_If>,
-    VersionedClause<ACCC_Wait>
+    VersionedClause<ACCC_If>
   ];
   let requiredClauses = [
     VersionedClause<ACCC_Attach>,
@@ -527,7 +529,8 @@
     VersionedClause<ACCC_Present>,
     VersionedClause<ACCC_Private>,
     VersionedClause<ACCC_DevicePtr>,
-    VersionedClause<ACCC_Attach>
+    VersionedClause<ACCC_Attach>,
+    VersionedClause<ACCC_Wait>
   ];
   let allowedOnceClauses = [
     VersionedClause<ACCC_Async>,
@@ -542,7 +545,6 @@
     VersionedClause<ACCC_Tile>,
     VersionedClause<ACCC_Vector>,
     VersionedClause<ACCC_VectorLength>,
-    VersionedClause<ACCC_Wait>,
     VersionedClause<ACCC_Worker>
   ];
   let allowedExclusiveClauses = [
Index: flang/test/Semantics/OpenACC/acc-kernels-loop.f90
===================================================================
--- flang/test/Semantics/OpenACC/acc-kernels-loop.f90
+++ flang/test/Semantics/OpenACC/acc-kernels-loop.f90
@@ -122,6 +122,11 @@
     a(i) = 3.14
   end do
 
+  !$acc kernels loop wait(wait1) wait(wait2)
+  do i = 1, N
+    a(i) = 3.14
+  end do
+
   !$acc kernels loop wait(1, 2) async(3)
   do i = 1, N
     a(i) = 3.14
Index: flang/test/Semantics/OpenACC/acc-data.f90
===================================================================
--- flang/test/Semantics/OpenACC/acc-data.f90
+++ flang/test/Semantics/OpenACC/acc-data.f90
@@ -63,6 +63,8 @@
 
   !$acc enter data create(aa) wait(wait1, wait2)
 
+  !$acc enter data create(aa) wait(wait1) wait(wait2)
+
   !$acc enter data attach(bb)
 
   !ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95469.319377.patch
Type: text/x-patch
Size: 2033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210126/4937c884/attachment.bin>


More information about the llvm-commits mailing list