[all-commits] [llvm/llvm-project] d6254e: Introduce the initial support for OpenMP kernel la...

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Oct 5 14:38:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d6254e1b2e6d1792d3a7085bd05d86adce15757e
      https://github.com/llvm/llvm-project/commit/d6254e1b2e6d1792d3a7085bd05d86adce15757e
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2023-10-05 (Thu, 05 Oct 2023)

  Changed paths:
    M clang/include/clang/AST/OpenMPClause.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/OpenMPClause.cpp
    M clang/lib/AST/StmtProfile.cpp
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    A clang/test/OpenMP/nvptx_target_teams_ompx_bare_codegen.cpp
    A clang/test/OpenMP/ompx_bare_messages.c
    M clang/test/OpenMP/target_teams_ast_print.cpp
    M clang/test/OpenMP/target_teams_codegen.cpp
    M clang/tools/libclang/CIndex.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMP.td

  Log Message:
  -----------
  Introduce the initial support for OpenMP kernel language (#66844)

This patch starts the support for OpenMP kernel language, basically to write
OpenMP target region in SIMT style, similar to kernel languages such as CUDA.
What included in this first patch is the `ompx_bare` clause for `target teams`
directive. When `ompx_bare` exists, globalization is disabled such that local
variables will not be globalized. The runtime init/deinit function calls will
not be emitted. That being said, almost all OpenMP executable directives are
not supported in the region, such as parallel, task. This patch doesn't include
the Sema checks for that, so the use of them is UB. Simple directives, such as
atomic, can be used. We provide a set of APIs (for C, they are prefix with
`ompx_`; for C++, they are in `ompx` namespace) to get thread id, block id, etc.
Please refer to
https://tianshilei.me/wp-content/uploads/llvm-hpc-2023.pdf for more details.




More information about the All-commits mailing list