[flang-commits] [flang] 2e389cb - [Flang][OpenACC] Make async clause on data consistent with elsewhere (#136866)
via flang-commits
flang-commits at lists.llvm.org
Wed Apr 23 09:03:08 PDT 2025
Author: Erich Keane
Date: 2025-04-23T09:03:03-07:00
New Revision: 2e389cb9aae0e9734fc8e16f6ebc6edb392d79a9
URL: https://github.com/llvm/llvm-project/commit/2e389cb9aae0e9734fc8e16f6ebc6edb392d79a9
DIFF: https://github.com/llvm/llvm-project/commit/2e389cb9aae0e9734fc8e16f6ebc6edb392d79a9.diff
LOG: [Flang][OpenACC] Make async clause on data consistent with elsewhere (#136866)
in #136610 we agreed that all async clauses on compute constructs should
act as 'only 1 per device-type-group'. On `data`, it has the same
specification language, and the same real requirements, so it seems
sensible to make it work the same way.
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 ac49532c495d5..473b91d555cea 100644
--- a/flang/test/Semantics/OpenACC/acc-data.f90
+++ b/flang/test/Semantics/OpenACC/acc-data.f90
@@ -187,6 +187,17 @@ program openacc_data_validity
!$acc data copy(aa) device_type(default) wait
!$acc end data
+ !ERROR: At most one ASYNC clause can appear on the DATA directive or in group separated by the DEVICE_TYPE clause
+ !$acc data copy(aa) async(async1) async(2)
+ !$acc end data
+
+ !$acc data copy(aa) async(async1) device_type(multicore) async(2) ! ok
+ !$acc end data
+
+ !ERROR: At most one ASYNC clause can appear on the DATA directive or in group separated by the DEVICE_TYPE clause
+ !$acc data copy(aa) async(async1) device_type(multicore) async(2) async(3)
+ !$acc end data
+
do i = 1, 100
!$acc data copy(aa)
!ERROR: CYCLE to construct outside of DATA construct is not allowed
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index 7dc97e6c89bee..d372fc221e4b4 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -284,11 +284,11 @@ 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_Async, 32>,
VersionedClause<ACCC_DeviceType, 32>,
VersionedClause<ACCC_Wait, 32>
];
More information about the flang-commits
mailing list