aboutsummaryrefslogtreecommitdiff
path: root/clang/tools
diff options
context:
space:
mode:
authorErich Keane <ekeane@nvidia.com>2024-05-21 06:51:25 -0700
committerGitHub <noreply@github.com>2024-05-21 06:51:25 -0700
commita15b685c2d868eaf408d05baa50baa3c9f5cc740 (patch)
treee45138bb2d94f7ced968aa572dded6aa8abd2604 /clang/tools
parentfbc798e4426b322ed0e03019c20d929f2eaade22 (diff)
downloadllvm-a15b685c2d868eaf408d05baa50baa3c9f5cc740.zip
llvm-a15b685c2d868eaf408d05baa50baa3c9f5cc740.tar.gz
llvm-a15b685c2d868eaf408d05baa50baa3c9f5cc740.tar.bz2
[OpenACC] Implement 'reduction' sema for compute constructs (#92808)
'reduction' has a few restrictions over normal 'var-list' clauses: 1- On parallel, a num_gangs can only have 1 argument when combined with reduction. These two aren't able to be combined on any other of the compute constructs however. 2- The vars all must be 'numerical data types' types of some sort, or a 'composite of numerical data types'. A list of types is given in the standard as a minimum, so we choose 'isScalar', which covers all of these types and keeps types that are actually numeric. Other compilers don't seem to implement the 'composite of numerical data types', though we do. 3- Because of the above restrictions, member-of-composite is not allowed, so any access via a memberexpr is disallowed. Array-element and sub-arrays (aka array sections) are both permitted, so long as they meet the requirements of #2. This patch implements all of these for compute constructs.
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/libclang/CIndex.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index bfbdb5b..f00ba9e 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -2855,6 +2855,10 @@ void OpenACCClauseEnqueue::VisitWaitClause(const OpenACCWaitClause &C) {
}
void OpenACCClauseEnqueue::VisitDeviceTypeClause(
const OpenACCDeviceTypeClause &C) {}
+void OpenACCClauseEnqueue::VisitReductionClause(
+ const OpenACCReductionClause &C) {
+ VisitVarList(C);
+}
} // namespace
void EnqueueVisitor::EnqueueChildren(const OpenACCClause *C) {