36-math.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. diff --git a/include/__math/rounding_functions.h b/include/__math/rounding_functions.h
  2. index 29e42fd..7943b6f 100644
  3. --- a/include/__math/rounding_functions.h
  4. +++ b/include/__math/rounding_functions.h
  5. @@ -204,7 +204,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEP
  6. // round
  7. -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); }
  8. +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); }
  9. template <class = int>
  10. _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT {
  11. @@ -222,7 +222,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCE
  12. // trunc
  13. -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_trunc(__x); }
  14. +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); }
  15. template <class = int>
  16. _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT {
  17. diff --git a/include/math.h b/include/math.h
  18. index b068ea3..5bde46a 100644
  19. --- a/include/math.h
  20. +++ b/include/math.h
  21. @@ -290,6 +290,9 @@ float truncf(float x);
  22. long double truncl(long double x);
  23. */
  24. +#ifdef __CUDACC__
  25. +#include <math_cuda.h>
  26. +#else
  27. #include <__config>
  28. @@ -504,6 +507,8 @@ using std::__math::trunc;
  29. #endif // __cplusplus
  30. +#endif // __CUDACC__
  31. +
  32. #else // _LIBCPP_MATH_H
  33. // This include lives outside the header guard in order to support an MSVC