[Openmp-commits] [PATCH] D106803: [OpenMP] Prototype opt-in new GPU device RTL

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 26 09:24:15 PDT 2021


jdoerfert created this revision.
jdoerfert added reviewers: grokos, jhuber6, ggeorgakoudis, tianshilei1992, JonChesterfield.
Herald added subscribers: jfb, guansong, bollu, yaxunl, mgorny.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

The "old" OpenMP GPU device runtime (D14254 <https://reviews.llvm.org/D14254>) has served us well for many
years but modernizing it has caused some pain recently. This patch
introduces an alternative which is mostly written from scratch embracing
OpenMP 5.X, C++, LLVM coding style (where applicable), and conceptual
interfaces. This new runtime is opt-in through a clang flag (D106793 <https://reviews.llvm.org/D106793>).
The new runtime is currently only build for nvptx and has "-new" in its
name.

The design is tailored towards middle-end optimizations rather than
front-end code generation choices, a trend we already started in the old
runtime a while back. In contrast to the old one, state is organized in
a simple manner rather than a "smart" one. While this can induce costs
it helps optimizations. Our expectation is that the majority of codes
can be optimized and a "simple" design is therefore preferable. The new
runtime does also avoid users to pay for things they do not use,
especially wrt. memory. The unlikely case of nested parallelism is
supported but costly to make the more likely case use less resources.

The worksharing and reduction implementation have been taken from the
old runtime and will be rewritten in the future if necessary.

Documentation and debug features are still mostly missing and will be
added over time.

All external symbols start with `__kmpc` for legacy reasons but should
be renamed once we switch over to a single runtime. All internal symbols
are placed in appropriate namespaces (anonymous or `_OMP`) to avoid name
clashes with user symbols.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106803

Files:
  openmp/libomptarget/CMakeLists.txt
  openmp/libomptarget/DeviceRTL/CMakeLists.txt
  openmp/libomptarget/DeviceRTL/include/Configuration.h
  openmp/libomptarget/DeviceRTL/include/Debug.h
  openmp/libomptarget/DeviceRTL/include/Interface.h
  openmp/libomptarget/DeviceRTL/include/Mapping.h
  openmp/libomptarget/DeviceRTL/include/State.h
  openmp/libomptarget/DeviceRTL/include/Synchronization.h
  openmp/libomptarget/DeviceRTL/include/Types.h
  openmp/libomptarget/DeviceRTL/include/Utils.h
  openmp/libomptarget/DeviceRTL/include/generated_microtask_cases.gen
  openmp/libomptarget/DeviceRTL/src/Configuration.cpp
  openmp/libomptarget/DeviceRTL/src/Debug.cpp
  openmp/libomptarget/DeviceRTL/src/Kernel.cpp
  openmp/libomptarget/DeviceRTL/src/Mapping.cpp
  openmp/libomptarget/DeviceRTL/src/Misc.cpp
  openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
  openmp/libomptarget/DeviceRTL/src/Reduction.cpp
  openmp/libomptarget/DeviceRTL/src/State.cpp
  openmp/libomptarget/DeviceRTL/src/Synchronization.cpp
  openmp/libomptarget/DeviceRTL/src/Tasking.cpp
  openmp/libomptarget/DeviceRTL/src/Utils.cpp
  openmp/libomptarget/DeviceRTL/src/Workshare.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106803.361692.patch
Type: text/x-patch
Size: 151609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210726/8a173a52/attachment-0001.bin>


More information about the Openmp-commits mailing list