|
CUB
|
Reduce-by-segment functor.
Given two cub::KeyValuePair inputs a and b and a binary associative combining operator , an instance of this functor returns a cub::KeyValuePair whose f(const T &x, const T &y)key field is a.key + a.key, and whose value field is either b.value if b.key is non-zero, or f(a.value, b.value) otherwise.
ReduceBySegmentOp is an associative, non-commutative binary combining operator for input sequences of cub::KeyValuePair pairings. Such sequences are typically used to represent a segmented set of values to be reduced and a corresponding set of {0,1}-valued integer "head flags" demarcating the first value of each segment.< Binary reduction operator to apply to values
Definition at line 249 of file thread_operators.cuh.
Public Methods | |
| __host__ __device__ __forceinline__ | ReduceBySegmentOp () |
| Constructor. | |
| __host__ __device__ __forceinline__ | ReduceBySegmentOp (ReductionOpT op) |
| Constructor. | |
| template<typename KeyValuePairT > | |
| __host__ __device__ __forceinline__ KeyValuePairT | operator() (const KeyValuePairT &first, const KeyValuePairT &second) |
| Scan operator. More... | |
Public Members | |
| ReductionOpT | op |
| Wrapped reduction operator. | |
|
inline |
Scan operator.
< KeyValuePair pairing of T (value) and OffsetT (head flag)
| first | First partial reduction |
| second | Second partial reduction |
Definition at line 262 of file thread_operators.cuh.
1.8.4