[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

Hal Finkel via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 15:45:45 PDT 2016


hfinkel added a comment.

In https://reviews.llvm.org/D25403#580416, @jlebar wrote:

> > Is this because the functions are in <cmath> instead of in <complex> are you don't want to mark all of <cmath> as host/device?
>
> Yes.  cmath is its own beast; we need to have our own implementation of it in order to direct the std functions to the appropriate low-level device functions.  (And even if this could somehow be made to work with libc++, we'd still need it for libstdc++, so doing it one way, even if it's horrible, is very likely preferable to doing it two ways.)


Okay. Why not fix the Clang builtins so that they're evaluatable for constant inputs in a constexpr context? Then we can do this and test the change.


https://reviews.llvm.org/D25403





More information about the cfe-commits mailing list