[Openmp-commits] [PATCH] D94698: [OpenMP][WIP][POC] Compile the device runtime as C++

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 14 09:17:06 PST 2021


jdoerfert created this revision.
Herald added subscribers: pengfei, jfb, guansong, bollu, yaxunl, mgorny.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

The main contribution of this patch is the new CMakeLists.txt which
shows how we can compile the device runtime as C++ for various targets
and subtargets. Running `ninja omptarget-device-rtl` results in

  libomptarget-device-rtl-nvptx64-sm35-ptx50.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx60.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx61.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx62.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx63.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx64.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx65.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx70.bc
  libomptarget-device-rtl-nvptx64-sm35-ptx71.bc
  libomptarget-device-rtl-nvptx-sm35-ptx50.bc
  libomptarget-device-rtl-nvptx-sm35-ptx60.bc
  libomptarget-device-rtl-nvptx-sm35-ptx61.bc
  libomptarget-device-rtl-nvptx-sm35-ptx62.bc
  libomptarget-device-rtl-nvptx-sm35-ptx63.bc
  libomptarget-device-rtl-nvptx-sm35-ptx64.bc
  libomptarget-device-rtl-nvptx-sm35-ptx65.bc
  libomptarget-device-rtl-nvptx-sm35-ptx70.bc
  libomptarget-device-rtl-nvptx-sm35-ptx71.bc
  libomptarget-device-rtl-x86_64-unknown-linux-gnu.bc

As part of this we should remove most of the source annotations, e.g.
INLINE, and EXTERN, as long as they are not strictly needed. SHARED
will be replaced by the macro used in D93135 <https://reviews.llvm.org/D93135> or D77472 <https://reviews.llvm.org/D77472>.

For lanemask and similar target dependent functions we should have a
begin/end declare variant file:

  // I'm gussing here:
  using kmpc_lanemask = uint64_t;
  
  void some_target_specific_function_decl(...);
  
  void __kmpc_some_target_specific_function_impl(...) {
    some_target_specific_function_decl(...);
  }


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94698

Files:
  openmp/libomptarget/deviceRTLs/CMakeLists.txt
  openmp/libomptarget/deviceRTLs/common/CMakeLists.txt
  openmp/libomptarget/deviceRTLs/common/debug.h
  openmp/libomptarget/deviceRTLs/common/device_environment.h
  openmp/libomptarget/deviceRTLs/common/include/target.h
  openmp/libomptarget/deviceRTLs/common/include/target_impl.h
  openmp/libomptarget/deviceRTLs/common/omptarget.h
  openmp/libomptarget/deviceRTLs/common/src/cancel.cu
  openmp/libomptarget/deviceRTLs/common/src/loop.cu
  openmp/libomptarget/deviceRTLs/common/state-queue.h
  openmp/libomptarget/deviceRTLs/common/state-queuei.h
  openmp/libomptarget/deviceRTLs/common/support.h
  openmp/libomptarget/deviceRTLs/common/target_atomic.h
  openmp/libomptarget/deviceRTLs/interface.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94698.316678.patch
Type: text/x-patch
Size: 84145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210114/a7417dc5/attachment-0001.bin>


More information about the Openmp-commits mailing list