aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/patches/36-math.patch
blob: 5ebdc1a41ab08d8f6444d3591428a9d701c20648 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 <class = int>
 _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 <class = int>
 _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 <math_cuda.h>
+#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