40 #include "../util_macro.cuh" 41 #include "../util_type.cuh" 42 #include "../util_namespace.cuh" 63 __host__ __device__ __forceinline__
bool operator()(
const T &a,
const T &b)
const 77 __host__ __device__ __forceinline__
bool operator()(
const T &a,
const T &b)
const 87 template <
typename EqualityOp>
94 __host__ __device__ __forceinline__
99 __host__ __device__ __forceinline__
bool operator()(
const T &a,
const T &b)
112 template <
typename T>
113 __host__ __device__ __forceinline__ T
operator()(
const T &a,
const T &b)
const 126 template <
typename T>
127 __host__ __device__ __forceinline__ T
operator()(
const T &a,
const T &b)
const 140 template <
typename T,
typename OffsetT>
148 if ((b.value > a.value) || ((a.value == b.value) && (b.key < a.key)))
161 template <
typename T>
162 __host__ __device__ __forceinline__ T
operator()(
const T &a,
const T &b)
const 175 template <
typename T,
typename OffsetT>
183 if ((b.value < a.value) || ((a.value == b.value) && (b.key < a.key)))
193 template <
typename B>
197 template <
typename A>
198 __host__ __device__ __forceinline__ B
operator()(
const A &a)
const 208 template <
typename ScanOp>
219 __host__ __device__ __forceinline__
223 template <
typename T>
224 __host__ __device__ __forceinline__
251 template <
typename ReductionOpT>
264 template <
typename KeyValuePairT>
265 __host__ __device__ __forceinline__ KeyValuePairT
operator()(
266 const KeyValuePairT &first,
267 const KeyValuePairT &second)
269 KeyValuePairT retval;
270 retval.key = first.key + second.key;
271 retval.value = (second.key) ?
273 op(first.value, second.value);
280 template <
typename ReductionOpT>
293 template <
typename KeyValuePairT>
294 __host__ __device__ __forceinline__ KeyValuePairT
operator()(
295 const KeyValuePairT &first,
296 const KeyValuePairT &second)
298 KeyValuePairT retval = second;
300 if (first.key == second.key)
301 retval.value =
op(first.value, retval.value);
__host__ __device__ __forceinline__ bool operator()(const T &a, const T &b) const
Boolean inequality operator, returns (a != b)
__host__ __device__ __forceinline__ InequalityWrapper(EqualityOp op)
Constructor.
< Binary reduction operator to apply to values
__host__ __device__ __forceinline__ B operator()(const A &a) const
Cast operator, returns (B) a
Optional outer namespace(s)
__host__ __device__ __forceinline__ KeyValuePair< OffsetT, T > operator()(const KeyValuePair< OffsetT, T > &a, const KeyValuePair< OffsetT, T > &b) const
Boolean max operator, preferring the item having the smaller offset in case of ties.
Default inequality functor.
__host__ __device__ __forceinline__ SwizzleScanOp(ScanOp scan_op)
Constructor.
A key identifier paired with a corresponding value.
Default equality functor.
ReductionOpT op
Wrapped reduction operator.
__host__ __device__ __forceinline__ ReduceByKeyOp(ReductionOpT op)
Constructor.
__host__ __device__ __forceinline__ KeyValuePairT operator()(const KeyValuePairT &first, const KeyValuePairT &second)
Scan operator.
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
Boolean sum operator, returns a + b
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b)
Switch the scan arguments.
ScanOp scan_op
Wrapped scan operator.
__host__ __device__ __forceinline__ ReduceBySegmentOp()
Constructor.
Arg max functor (keeps the value and offset of the first occurrence of the larger item)
Reduce-by-segment functor.
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
Boolean max operator, returns (a > b) ? a : b
__host__ __device__ __forceinline__ ReduceBySegmentOp(ReductionOpT op)
Constructor.
__host__ __device__ __forceinline__ T operator()(const T &a, const T &b) const
Boolean min operator, returns (a < b) ? a : b
__host__ __device__ __forceinline__ KeyValuePairT operator()(const KeyValuePairT &first, const KeyValuePairT &second)
Scan operator.
Arg min functor (keeps the value and offset of the first occurrence of the smallest item)
#define CUB_MIN(a, b)
Select minimum(a, b)
__host__ __device__ __forceinline__ bool operator()(const T &a, const T &b)
Boolean inequality operator, returns (a != b)
ReductionOpT op
Wrapped reduction operator.
Inequality functor (wraps equality functor)
#define CUB_MAX(a, b)
Select maximum(a, b)
__host__ __device__ __forceinline__ ReduceByKeyOp()
Constructor.
EqualityOp op
Wrapped equality operator.
__host__ __device__ __forceinline__ bool operator()(const T &a, const T &b) const
Boolean equality operator, returns (a == b)
__host__ __device__ __forceinline__ KeyValuePair< OffsetT, T > operator()(const KeyValuePair< OffsetT, T > &a, const KeyValuePair< OffsetT, T > &b) const
Boolean min operator, preferring the item having the smaller offset in case of ties.
Binary operator wrapper for switching non-commutative scan arguments.