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
101 return a < b ? a : b;
111 HIPCUB_HOST_DEVICE
inline
112 constexpr KeyValuePair<Key, Value>
113 operator()(
const KeyValuePair<Key, Value>& a,
114 const KeyValuePair<Key, Value>& b)
const
116 return ((b.value > a.value) || ((a.value == b.value) && (b.key < a.key))) ? b : a;
126 HIPCUB_HOST_DEVICE
inline
127 constexpr KeyValuePair<Key, Value>
128 operator()(
const KeyValuePair<Key, Value>& a,
129 const KeyValuePair<Key, Value>& b)
const
131 return ((b.value < a.value) || ((a.value == b.value) && (b.key < a.key))) ? b : a;
159 class InputIteratorT,
160 class OutputIteratorT,
163 struct convert_result_type_wrapper
165 using input_type =
typename std::iterator_traits<InputIteratorT>::value_type;
166 using output_type =
typename std::iterator_traits<OutputIteratorT>::value_type;
168 typename std::conditional<
169 std::is_void<output_type>::value, input_type, output_type
172 convert_result_type_wrapper(BinaryFunction op) : op(op) {}
175 HIPCUB_HOST_DEVICE
inline
176 constexpr result_type operator()(
const T &a,
const T &b)
const
178 return static_cast<result_type
>(op(a, b));
185 class InputIteratorT,
186 class OutputIteratorT,
190 convert_result_type_wrapper<InputIteratorT, OutputIteratorT, BinaryFunction>
191 convert_result_type(BinaryFunction op)
193 return convert_result_type_wrapper<InputIteratorT, OutputIteratorT, BinaryFunction>(op);
Definition: thread_operators.hpp:106
Definition: thread_operators.hpp:121
Definition: thread_operators.hpp:40
Definition: thread_operators.hpp:61
Definition: thread_operators.hpp:50
Definition: thread_operators.hpp:86
Definition: thread_operators.hpp:96
Definition: thread_operators.hpp:76