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

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 15:01:24 PDT 2023


clementval created this revision.
clementval added a reviewer: razvanlupusoru.
Herald added a subscriber: sunshaoce.
Herald added projects: Flang, All.
clementval requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

>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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154013

Files:
  flang/test/Semantics/OpenACC/acc-data.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
@@ -270,9 +270,14 @@
 // 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>,
Index: flang/test/Semantics/OpenACC/acc-data.f90
===================================================================
--- flang/test/Semantics/OpenACC/acc-data.f90
+++ flang/test/Semantics/OpenACC/acc-data.f90
@@ -178,4 +178,13 @@
   !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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154013.535543.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230628/7657480f/attachment.bin>


More information about the llvm-commits mailing list