Reducer
Reducer
Section titled “Reducer”#include <reductions.hh>template<typename T, typename Traits>struct ReducerDefined in src/lib/ncarray/reductions.hh:605
A wrapping class for reduction traits.
The Reducer templates on the various reduction traits binding the static functions into an instantiable struct. In some cases, it may be preferable to pass an object to perform the reductions, where passing the static functions, or lambdas wrapping them, may be less ideal, or impossible.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
identity |
function |
Declared here |
transform |
function |
Declared here |
reduce |
function |
Declared here |
store |
function |
Declared here |
atomic |
function |
Declared here |
dual_atomic |
function |
Declared here |
AccumT |
typedef |
Declared here |
OutT |
typedef |
Declared here |
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
NCA_HDAccumT |
identity const inline |
|
NCA_HDAccumT |
transform const inline |
|
NCA_HDAccumT |
reduce const inline |
|
NCA_HD auto |
store const inline |
|
NCA_HD void |
atomic inline |
|
NCA_HD void |
dual_atomic inline |
identity
Section titled “identity”const inline
inline NCA_HDAccumT identity() constDefined in src/lib/ncarray/reductions.hh:609
transform
Section titled “transform”const inline
inline NCA_HDAccumT transform(ssize_t idx, T val) constDefined in src/lib/ncarray/reductions.hh:613
reduce
Section titled “reduce”const inline
inline NCA_HDAccumT reduce(AccumT a, AccumT b) constDefined in src/lib/ncarray/reductions.hh:617
const inline
inline NCA_HD auto store(AccumT val, double ddof = 0.0) constDefined in src/lib/ncarray/reductions.hh:621
atomic
Section titled “atomic”inline
inline NCA_HD void atomic(AccumT * dest, AccumT val)Defined in src/lib/ncarray/reductions.hh:625
dual_atomic
Section titled “dual_atomic”inline
inline NCA_HD void dual_atomic(AccumT * scratch, AccumT val, OutT * res, double ddof = 0.0)Defined in src/lib/ncarray/reductions.hh:631
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
AccumT |
|
OutT |
AccumT
Section titled “AccumT”using AccumT = typename Traits::template AccumT< T >Defined in src/lib/ncarray/reductions.hh:606
using OutT = typename Traits::template OutT< T >Defined in src/lib/ncarray/reductions.hh:607