29
29
#include < cudf/utilities/error.hpp>
30
30
#include < cudf/utilities/traits.hpp>
31
31
32
+ #include < cuda/std/functional>
33
+
32
34
#include < type_traits>
33
35
34
36
namespace cudf {
@@ -42,7 +44,7 @@ template <typename LHS,
42
44
std::enable_if_t <cudf::is_relationally_comparable<LHS, RHS>()>* = nullptr >
43
45
CUDF_HOST_DEVICE inline auto min (LHS const & lhs, RHS const & rhs)
44
46
{
45
- return std::min (lhs, rhs);
47
+ return cuda:: std::min (lhs, rhs);
46
48
}
47
49
48
50
/* *
@@ -53,7 +55,7 @@ template <typename LHS,
53
55
std::enable_if_t <cudf::is_relationally_comparable<LHS, RHS>()>* = nullptr >
54
56
CUDF_HOST_DEVICE inline auto max (LHS const & lhs, RHS const & rhs)
55
57
{
56
- return std::max (lhs, rhs);
58
+ return cuda:: std::max (lhs, rhs);
57
59
}
58
60
} // namespace detail
59
61
@@ -68,20 +70,20 @@ struct DeviceSum {
68
70
}
69
71
70
72
template <typename T, std::enable_if_t <cudf::is_timestamp<T>()>* = nullptr >
71
- static constexpr T identity ()
73
+ CUDF_HOST_DEVICE static constexpr T identity ()
72
74
{
73
75
return T{typename T::duration{0 }};
74
76
}
75
77
76
78
template <typename T,
77
79
std::enable_if_t <!cudf::is_timestamp<T>() && !cudf::is_fixed_point<T>()>* = nullptr >
78
- static constexpr T identity ()
80
+ CUDF_HOST_DEVICE static constexpr T identity ()
79
81
{
80
82
return T{0 };
81
83
}
82
84
83
85
template <typename T, std::enable_if_t <cudf::is_fixed_point<T>()>* = nullptr >
84
- static constexpr T identity ()
86
+ CUDF_HOST_DEVICE static constexpr T identity ()
85
87
{
86
88
#ifndef __CUDA_ARCH__
87
89
CUDF_FAIL (" fixed_point does not yet support device operator identity" );
@@ -109,7 +111,7 @@ struct DeviceCount {
109
111
}
110
112
111
113
template <typename T>
112
- static constexpr T identity ()
114
+ CUDF_HOST_DEVICE static constexpr T identity ()
113
115
{
114
116
return T{};
115
117
}
@@ -129,7 +131,7 @@ struct DeviceMin {
129
131
template <typename T,
130
132
std::enable_if_t <!std::is_same_v<T, cudf::string_view> && !cudf::is_dictionary<T>() &&
131
133
!cudf::is_fixed_point<T>()>* = nullptr >
132
- static constexpr T identity ()
134
+ CUDF_HOST_DEVICE static constexpr T identity ()
133
135
{
134
136
// chrono types do not have std::numeric_limits specializations and should use T::max()
135
137
// https://eel.is/c++draft/numeric.limits.general#6
@@ -143,7 +145,7 @@ struct DeviceMin {
143
145
}
144
146
145
147
template <typename T, std::enable_if_t <cudf::is_fixed_point<T>()>* = nullptr >
146
- static constexpr T identity ()
148
+ CUDF_HOST_DEVICE static constexpr T identity ()
147
149
{
148
150
#ifndef __CUDA_ARCH__
149
151
CUDF_FAIL (" fixed_point does not yet support DeviceMin identity" );
@@ -161,7 +163,7 @@ struct DeviceMin {
161
163
}
162
164
163
165
template <typename T, std::enable_if_t <cudf::is_dictionary<T>()>* = nullptr >
164
- static constexpr T identity ()
166
+ CUDF_HOST_DEVICE static constexpr T identity ()
165
167
{
166
168
return static_cast <T>(T::max_value ());
167
169
}
@@ -181,7 +183,7 @@ struct DeviceMax {
181
183
template <typename T,
182
184
std::enable_if_t <!std::is_same_v<T, cudf::string_view> && !cudf::is_dictionary<T>() &&
183
185
!cudf::is_fixed_point<T>()>* = nullptr >
184
- static constexpr T identity ()
186
+ CUDF_HOST_DEVICE static constexpr T identity ()
185
187
{
186
188
// chrono types do not have std::numeric_limits specializations and should use T::min()
187
189
// https://eel.is/c++draft/numeric.limits.general#6
@@ -195,7 +197,7 @@ struct DeviceMax {
195
197
}
196
198
197
199
template <typename T, std::enable_if_t <cudf::is_fixed_point<T>()>* = nullptr >
198
- static constexpr T identity ()
200
+ CUDF_HOST_DEVICE static constexpr T identity ()
199
201
{
200
202
#ifndef __CUDA_ARCH__
201
203
CUDF_FAIL (" fixed_point does not yet support DeviceMax identity" );
@@ -212,7 +214,7 @@ struct DeviceMax {
212
214
}
213
215
214
216
template <typename T, std::enable_if_t <cudf::is_dictionary<T>()>* = nullptr >
215
- static constexpr T identity ()
217
+ CUDF_HOST_DEVICE static constexpr T identity ()
216
218
{
217
219
return static_cast <T>(T::lowest_value ());
218
220
}
@@ -229,13 +231,13 @@ struct DeviceProduct {
229
231
}
230
232
231
233
template <typename T, std::enable_if_t <!cudf::is_fixed_point<T>()>* = nullptr >
232
- static constexpr T identity ()
234
+ CUDF_HOST_DEVICE static constexpr T identity ()
233
235
{
234
236
return T{1 };
235
237
}
236
238
237
239
template <typename T, std::enable_if_t <cudf::is_fixed_point<T>()>* = nullptr >
238
- static constexpr T identity ()
240
+ CUDF_HOST_DEVICE static constexpr T identity ()
239
241
{
240
242
#ifndef __CUDA_ARCH__
241
243
CUDF_FAIL (" fixed_point does not yet support DeviceProduct identity" );
0 commit comments