[Openmp-commits] [PATCH] D121467: [Libomptarget] Create device math wrappers

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 11 07:57:02 PST 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, ggeorgakoudis.
Herald added a subscriber: mgorny.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

This patch creates new bitcode libraries to be used when compiling for
the device. They define math function wrappers that first transform the
generic `__omp_sin` calls to original math function's name. Then we
transform the math function to the device specific `__nv_sin`. This
level of indirection was necessy all to avoid the declarations in
<math.h> that are not compatible with the device.

Depends on D121466 <https://reviews.llvm.org/D121466>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121467

Files:
  openmp/libomptarget/CMakeLists.txt
  openmp/libomptarget/DeviceLib/CMakeLists.txt
  openmp/libomptarget/DeviceLib/include/Headers/__clang_cuda_device_functions.h
  openmp/libomptarget/DeviceLib/include/Headers/__clang_cuda_libdevice_declares.h
  openmp/libomptarget/DeviceLib/include/Headers/__clang_cuda_math.h
  openmp/libomptarget/DeviceLib/include/Headers/__clang_hip_libdevice_declares.h
  openmp/libomptarget/DeviceLib/include/Headers/__clang_hip_math.h
  openmp/libomptarget/DeviceLib/include/OpenMPMath.h
  openmp/libomptarget/DeviceLib/src/DeviceLibm.cpp
  openmp/libomptarget/DeviceLib/src/OpenMPMath.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121467.414660.patch
Type: text/x-patch
Size: 184406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220311/7b410cf2/attachment-0001.bin>


More information about the Openmp-commits mailing list