OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
cub::ReduceBySegmentOp< ReductionOpT > Struct Template Reference

Reduce-by-segment functor. More...

Detailed Description

template<typename ReductionOpT>
struct cub::ReduceBySegmentOp< ReductionOpT >

Reduce-by-segment functor.

Given two cub::KeyValuePair inputs a and b and a binary associative combining operator f(const T &x, const T &y), an instance of this functor returns a cub::KeyValuePair whose key field is a.key + b.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 252 of file thread_operators.cuh.

Public Member Functions

__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.
 

Data Fields

ReductionOpT op
 Wrapped reduction operator.
 

Constructor & Destructor Documentation

◆ ReduceBySegmentOp() [1/2]

template<typename ReductionOpT >
__host__ __device__ __forceinline__ cub::ReduceBySegmentOp< ReductionOpT >::ReduceBySegmentOp ( )
inline

Constructor.

Definition at line 258 of file thread_operators.cuh.

◆ ReduceBySegmentOp() [2/2]

template<typename ReductionOpT >
__host__ __device__ __forceinline__ cub::ReduceBySegmentOp< ReductionOpT >::ReduceBySegmentOp ( ReductionOpT  op)
inline

Constructor.

Definition at line 261 of file thread_operators.cuh.

Member Function Documentation

◆ operator()()

template<typename ReductionOpT >
template<typename KeyValuePairT >
__host__ __device__ __forceinline__ KeyValuePairT cub::ReduceBySegmentOp< ReductionOpT >::operator() ( const KeyValuePairT &  first,
const KeyValuePairT &  second 
)
inline

Scan operator.

< KeyValuePair pairing of T (value) and OffsetT (head flag)

Parameters
firstFirst partial reduction
secondSecond partial reduction

Definition at line 265 of file thread_operators.cuh.

Field Documentation

◆ op

template<typename ReductionOpT >
ReductionOpT cub::ReduceBySegmentOp< ReductionOpT >::op

Wrapped reduction operator.

Definition at line 255 of file thread_operators.cuh.


The documentation for this struct was generated from the following file: