[PATCH] D152389: [flang][openacc] Remove single reduction clause limitation
Razvan Lupusoru via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 11:13:31 PDT 2023
razvanlupusoru created this revision.
razvanlupusoru added reviewers: clementval, vzakhari.
Herald added a subscriber: sunshaoce.
Herald added a project: All.
razvanlupusoru requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The constraint that a single reduction clause is allowed is actually
not valid as per OpenACC specification. Multiple reduction clauses
are allowed, especially since reduction clauses can have different
reduction operators.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D152389
Files:
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
@@ -338,6 +338,7 @@
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
VersionedClause<ACCC_FirstPrivate>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
@@ -346,7 +347,6 @@
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_VectorLength>
];
@@ -368,13 +368,13 @@
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
VersionedClause<ACCC_FirstPrivate>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
VersionedClause<ACCC_Async>,
VersionedClause<ACCC_Default>,
VersionedClause<ACCC_If>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>
];
}
@@ -383,12 +383,12 @@
def ACC_Loop : Directive<"loop"> {
let allowedClauses = [
VersionedClause<ACCC_DeviceType>,
- VersionedClause<ACCC_Private>
+ VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>
];
let allowedOnceClauses = [
VersionedClause<ACCC_Collapse>,
VersionedClause<ACCC_Gang>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
VersionedClause<ACCC_Worker>
@@ -535,6 +535,7 @@
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_DevicePtr>,
VersionedClause<ACCC_Attach>,
VersionedClause<ACCC_Wait>
@@ -547,7 +548,6 @@
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
@@ -575,6 +575,7 @@
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Wait>
];
@@ -586,7 +587,6 @@
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Vector>,
VersionedClause<ACCC_VectorLength>,
@@ -613,6 +613,7 @@
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
@@ -621,7 +622,6 @@
VersionedClause<ACCC_Default>,
VersionedClause<ACCC_Gang>,
VersionedClause<ACCC_If>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152389.529376.patch
Type: text/x-patch
Size: 3134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/df118df4/attachment.bin>
More information about the llvm-commits
mailing list