[PATCH] D91888: [flang][openacc] Add clause validaty tests for data construct + fix default restriction

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 12:12:29 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa366188d801c: [flang][openacc] Add clause validaty tests for data construct + fix default… (authored by clementval).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91888/new/

https://reviews.llvm.org/D91888

Files:
  flang/test/Semantics/acc-clause-validity.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
@@ -257,7 +257,8 @@
 // 2.6.5
 def ACC_Data : Directive<"data"> {
   let allowedOnceClauses = [
-    VersionedClause<ACCC_If>
+    VersionedClause<ACCC_If>,
+    VersionedClause<ACCC_Default>
   ];
   let requiredClauses = [
     VersionedClause<ACCC_Attach>,
Index: flang/test/Semantics/acc-clause-validity.f90
===================================================================
--- flang/test/Semantics/acc-clause-validity.f90
+++ flang/test/Semantics/acc-clause-validity.f90
@@ -131,7 +131,42 @@
   !$acc data
   !$acc end data
 
-  !$acc data copyin(i)
+  !$acc data copy(aa) if(.true.)
+  !$acc end data
+
+  !$acc data copy(aa) if(ifCondition)
+  !$acc end data
+
+  !$acc data copy(aa, bb, cc)
+  !$acc end data
+
+  !$acc data copyin(aa) copyin(readonly: bb) copyout(cc)
+  !$acc end data
+
+  !$acc data copyin(readonly: aa, bb) copyout(zero: cc)
+  !$acc end data
+
+  !$acc data create(aa, bb(:,:)) create(zero: cc(:,:))
+  !$acc end data
+
+  !$acc data no_create(aa) present(bb, cc)
+  !$acc end data
+
+  !$acc data deviceptr(aa) attach(bb, cc)
+  !$acc end data
+
+  !$acc data copy(aa, bb) default(none)
+  !$acc end data
+
+  !$acc data copy(aa, bb) default(present)
+  !$acc end data
+
+  !ERROR: At most one DEFAULT clause can appear on the DATA directive
+  !$acc data copy(aa, bb) default(none) default(present)
+  !$acc end data
+
+  !ERROR: At most one IF clause can appear on the DATA directive
+  !$acc data copy(aa) if(.true.) if(ifCondition)
   !$acc end data
 
   !$acc data copyin(i)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91888.309608.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201204/945d61b5/attachment.bin>


More information about the llvm-commits mailing list