Skip to content

Commit

Permalink
[HIP] Use native math functions for -fcuda-approx-transcendentals
Browse files Browse the repository at this point in the history
CUDA allows replacing standard math functions with less accurate
native math functions when -use_fast_math is specified
(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#intrinsic-functions).
Cuda-clang does this when -fcuda-approx-transcendentals
or -ffast-math is specified. HIP-clang currently passes option
-fcuda-approx-transcendentals to clang -cc1 and predefines
__CLANG_CUDA_APPROX_TRANSCENDENTALS__ but does
not replace standard math functions with native math functions.

This patch implements this in a similar approach as cuda-clang.

Reviewed by: Brian Sumner, Matt Arsenault

Differential Revision: https://reviews.llvm.org/D154790
  • Loading branch information
yxsamliu committed Jul 25, 2023
1 parent e93cbd1 commit a0709e2
Show file tree
Hide file tree
Showing 2 changed files with 1,460 additions and 183 deletions.

0 comments on commit a0709e2

Please sign in to comment.