diff --git a/include/__math/rounding_functions.h b/include/__math/rounding_functions.h index 29e42fd..7943b6f 100644 --- a/include/__math/rounding_functions.h +++ b/include/__math/rounding_functions.h @@ -204,7 +204,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEP // round -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); } +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); } template _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { @@ -222,7 +222,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCE // trunc -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_trunc(__x); } +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); } template _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { diff --git a/include/math.h b/include/math.h index b068ea3..5bde46a 100644 --- a/include/math.h +++ b/include/math.h @@ -290,6 +290,9 @@ float truncf(float x); long double truncl(long double x); */ +#ifdef __CUDACC__ +#include +#else #include <__config> @@ -504,6 +507,8 @@ using std::__math::trunc; #endif // __cplusplus +#endif // __CUDACC__ + #else // _LIBCPP_MATH_H // This include lives outside the header guard in order to support an MSVC