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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 09:46:13 PDT 2023


tra added a comment.

Looks good in general.



================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:7221-7223
+    bool UseApproxTranscendentals = false;
+    if (Args.hasFlag(options::OPT_ffast_math, options::OPT_fno_fast_math,
+                     false))
----------------
```
bool UseApproxTranscendentals = Args.hasFlag(options::OPT_ffast_math, options::OPT_fno_fast_math,  false));
```


================
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:1292-1293
+  if (LangOpts.GPUDeviceApproxTranscendentals) {
+    Builder.defineMacro(Twine("__CLANG_") + (LangOpts.HIP ? "HIP" : "CUDA") +
+                        "_APPROX_TRANSCENDENTALS__");
   }
----------------
We may want to rename the macro to `__CLANG_GPU_APPROX_TRANSCENDENTALS__`, too. 



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154797/new/

https://reviews.llvm.org/D154797



More information about the cfe-commits mailing list