30 #ifndef HIBCUB_ROCPRIM_THREAD_THREAD_OPERATORS_HPP_ 31 #define HIBCUB_ROCPRIM_THREAD_THREAD_OPERATORS_HPP_ 33 #include "../../../config.hpp" 35 #include "../util_type.hpp" 37 BEGIN_HIPCUB_NAMESPACE
42 HIPCUB_HOST_DEVICE
inline 43 constexpr
bool operator()(
const T& a,
const T& b)
const 52 HIPCUB_HOST_DEVICE
inline 53 constexpr
bool operator()(
const T& a,
const T& b)
const 59 template <
class EqualityOp>
64 HIPCUB_HOST_DEVICE
inline 68 HIPCUB_HOST_DEVICE
inline 69 bool operator()(
const T &a,
const T &b)
78 HIPCUB_HOST_DEVICE
inline 79 constexpr T operator()(
const T &a,
const T &b)
const 88 HIPCUB_HOST_DEVICE
inline 89 constexpr T operator()(
const T &a,
const T &b)
const 98 HIPCUB_HOST_DEVICE
inline 99 constexpr T operator()(
const T &a,
const T &b)
const 108 HIPCUB_HOST_DEVICE
inline 109 constexpr T operator()(
const T &a,
const T &b)
const 111 return a < b ? b : a;
118 HIPCUB_HOST_DEVICE
inline 119 constexpr T operator()(
const T &a,
const T &b)
const 121 return a < b ? a : b;
131 HIPCUB_HOST_DEVICE
inline 132 constexpr KeyValuePair<Key, Value>
133 operator()(
const KeyValuePair<Key, Value>& a,
134 const KeyValuePair<Key, Value>& b)
const 136 return ((b.value > a.value) || ((a.value == b.value) && (b.key < a.key))) ? b : a;
146 HIPCUB_HOST_DEVICE
inline 147 constexpr KeyValuePair<Key, Value>
148 operator()(
const KeyValuePair<Key, Value>& a,
149 const KeyValuePair<Key, Value>& b)
const 151 return ((b.value < a.value) || ((a.value == b.value) && (b.key < a.key))) ? b : a;
155 template <
typename B>
158 template <
typename A>
159 HIPCUB_HOST_DEVICE
inline 160 B operator()(
const A &a)
const 166 template <
typename ScanOp>
173 HIPCUB_HOST_DEVICE
inline 178 template <
typename T>
179 HIPCUB_HOST_DEVICE
inline 180 T operator()(
const T &a,
const T &b)
185 return scan_op(_b, _a);
189 template <
typename ReductionOpT>
194 HIPCUB_HOST_DEVICE
inline 199 HIPCUB_HOST_DEVICE
inline 204 template <
typename KeyValuePairT>
205 HIPCUB_HOST_DEVICE
inline 206 KeyValuePairT operator()(
207 const KeyValuePairT &first,
208 const KeyValuePairT &second)
210 KeyValuePairT retval;
211 retval.key = first.key + second.key;
212 retval.value = (second.key) ?
214 op(first.value, second.value);
219 template <
typename ReductionOpT>
224 HIPCUB_HOST_DEVICE
inline 229 HIPCUB_HOST_DEVICE
inline 234 template <
typename KeyValuePairT>
235 HIPCUB_HOST_DEVICE
inline 236 KeyValuePairT operator()(
237 const KeyValuePairT &first,
238 const KeyValuePairT &second)
240 KeyValuePairT retval = second;
242 if (first.key == second.key)
244 retval.value = op(first.value, retval.value);
250 template <
typename BinaryOpT>
256 explicit BinaryFlip(BinaryOpT binary_op) : binary_op(binary_op)
260 template <
typename T,
typename U>
262 operator()(T &&t, U &&u) -> decltype(binary_op(std::forward<U>(u),
265 return binary_op(std::forward<U>(u), std::forward<T>(t));
269 template <
typename BinaryOpT>
300 class InputIteratorT,
301 class OutputIteratorT,
306 using input_type =
typename std::iterator_traits<InputIteratorT>::value_type;
307 using output_type =
typename std::iterator_traits<OutputIteratorT>::value_type;
309 typename std::conditional<
310 std::is_void<output_type>::value, input_type, output_type
316 HIPCUB_HOST_DEVICE
inline 317 constexpr result_type operator()(
const T &a,
const T &b)
const 319 return static_cast<result_type
>(op(a, b));
326 class InputIteratorT,
327 class OutputIteratorT,
332 convert_result_type(BinaryFunction op)
341 #endif // HIBCUB_ROCPRIM_THREAD_THREAD_OPERATORS_HPP_ Definition: thread_operators.hpp:190
Definition: thread_operators.hpp:167
Definition: thread_operators.hpp:105
Definition: thread_operators.hpp:95
Definition: thread_operators.hpp:251
Definition: block_histogram.hpp:41
Definition: thread_operators.hpp:220
Arg max functor - Because NVIDIA's hipcub::ArgMax doesn't work with bfloat16 (HOST-SIDE) ...
Definition: thread_operators.hpp:125
Arg min functor - Because NVIDIA's hipcub::ArgMin doesn't work with bfloat16 (HOST-SIDE) ...
Definition: thread_operators.hpp:140
Definition: thread_operators.hpp:85
Definition: thread_operators.hpp:156
Definition: thread_operators.hpp:60
Definition: thread_operators.hpp:49
Definition: thread_operators.hpp:304
Definition: thread_operators.hpp:75
Definition: thread_operators.hpp:39
Definition: thread_operators.hpp:115