[PATCH] D154797: [CUDA][HIP] Rename and fix `-fcuda-approx-transcendentals`

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 9 13:28:44 PDT 2023


yaxunl created this revision.
yaxunl added reviewers: tra, MaskRay, b-sumner.
Herald added subscribers: mattd, carlosgalvezp.
Herald added a project: All.
yaxunl requested review of this revision.

Rename `-fcuda-approx-transcendentals` as
`-fgpu-approx-transcendentals` and pass it
to both device and host clang -cc1.

Fix its interaction with `-ffast-math` to allow
`-fno-gpu-approx-transcendentals` to override
the implicit `-fcuda-approx-transcendentals`
due to `-ffast-math`.

Rename the predefined macro to be
`__CLANG_[CUDA|HIP]_APPROX_TRANSCENDENTALS__`
depending on the language. Emit the macro for both
device and host compilation.


https://reviews.llvm.org/D154797

Files:
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/lib/Driver/ToolChains/HIPAMD.cpp
  clang/lib/Driver/ToolChains/HIPSPV.cpp
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/lib/Headers/__clang_cuda_math.h
  clang/lib/Headers/__clang_cuda_runtime_wrapper.h
  clang/lib/Headers/__clang_hip_math.h
  clang/test/Driver/hip-macros.hip
  clang/test/Driver/hip-options.hip
  clang/test/Headers/__clang_hip_math.hip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154797.538447.patch
Type: text/x-patch
Size: 12605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230709/bb9ef8c9/attachment.bin>


More information about the cfe-commits mailing list