[PATCH] D85879: [OpenMP] Overload `std::isnan` and friends multiple times for the GPU

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 12:10:53 PDT 2020


jdoerfert added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_cmath.h:85
+//        (note that we do not create implicit base functions here). To avoid
+//        this clash we add a new trait to some of them that is always true
+//        (this is LLVM after all ;)). It will only influence the mangled name
----------------
tra wrote:
> If you just want to disable some existing declarations that get in the way, one way to do it would be to redeclare them with an `__arrtibute__((enable_if(false)))`
> 
> Having overloads with different return types will be observable.
We need both overloads as we don't know what return type the system uses. I modeled the test below this way, that is we don't know if `isnan` has a `bool` or `int` return type.

> Having overloads with different return types will be observable.

Unsure what observable effect you expect, the variants are there, yes, but they have different names (wrt the base function and the other variant function). The variant without a base function is simply an unused internal function. Could you elaborate what problem you expect?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85879



More information about the cfe-commits mailing list