[all-commits] [llvm/llvm-project] a15b68: [OpenACC] Implement 'reduction' sema for compute c...

Erich Keane via All-commits all-commits at lists.llvm.org
Tue May 21 06:51:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a15b685c2d868eaf408d05baa50baa3c9f5cc740
      https://github.com/llvm/llvm-project/commit/a15b685c2d868eaf408d05baa50baa3c9f5cc740
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2024-05-21 (Tue, 21 May 2024)

  Changed paths:
    M clang/include/clang/AST/OpenACCClause.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/OpenACCClauses.def
    M clang/include/clang/Basic/OpenACCKinds.h
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/SemaOpenACC.h
    M clang/lib/AST/OpenACCClause.cpp
    M clang/lib/AST/StmtProfile.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/Parse/ParseOpenACC.cpp
    M clang/lib/Sema/SemaOpenACC.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/AST/ast-print-openacc-compute-construct.cpp
    M clang/test/ParserOpenACC/parse-clauses.c
    M clang/test/SemaOpenACC/compute-construct-attach-clause.c
    M clang/test/SemaOpenACC/compute-construct-clause-ast.cpp
    M clang/test/SemaOpenACC/compute-construct-copy-clause.c
    M clang/test/SemaOpenACC/compute-construct-copy-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-copyin-clause.c
    M clang/test/SemaOpenACC/compute-construct-copyin-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-copyout-clause.c
    M clang/test/SemaOpenACC/compute-construct-copyout-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-create-clause.c
    M clang/test/SemaOpenACC/compute-construct-create-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-device_type-clause.c
    M clang/test/SemaOpenACC/compute-construct-deviceptr-clause.c
    M clang/test/SemaOpenACC/compute-construct-firstprivate-clause.c
    M clang/test/SemaOpenACC/compute-construct-firstprivate-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-no_create-clause.c
    M clang/test/SemaOpenACC/compute-construct-no_create-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-present-clause.c
    M clang/test/SemaOpenACC/compute-construct-present-clause.cpp
    M clang/test/SemaOpenACC/compute-construct-private-clause.c
    M clang/test/SemaOpenACC/compute-construct-private-clause.cpp
    A clang/test/SemaOpenACC/compute-construct-reduction-clause.c
    A clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp
    M clang/tools/libclang/CIndex.cpp

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list