[PATCH] D90409: [HIP] Math Headers to use type promotion

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 12:18:40 PST 2020


tra added a comment.

In D90409#2371679 <https://reviews.llvm.org/D90409#2371679>, @jlebar wrote:

>> LGTM. I think the change would make sense for CUDA, too. @jlebar - WDYT?
>
> I agree that the C and C++ standard libraries should behave the same in CUDA mode and host mode!
>
> But if doing so would make our behavior different than nvcc's, maybe we could emit a warning or something?  Like, "this code you wrote maybe for nvcc is going to do something different with clang."

Interestingly enough CUDA 10.1+ already promotes integer `fma()` arguments to double:
https://godbolt.org/z/crbqTe

I wonder what makes HIP different to require this change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90409



More information about the cfe-commits mailing list