GReducible stores per thread values of a variable of type T. More...
#include <Accumulator.h>
Public Member Functions | |
| GReducible (const BinFunc &f=BinFunc()) | |
| void | update (const T &rhs) |
| Updates the thread local value by applying the reduction operator to current and newly provided value. | |
| T & | reduce () |
| Returns the final reduction value. | |
| void | reset () |
| reset value | |
Protected Member Functions | |
| GReducible (const BinFunc &f, const T &initial) | |
Protected Attributes | |
| BinFunc | m_func |
| Galois::Runtime::PerThreadStorage < T > | m_data |
| const T | m_initial |
GReducible stores per thread values of a variable of type T.
The final value is obtained by performing a reduction on per thread values using the provided binary functor BinFunc. BinFunc updates values in place and conforms to:
void operator()(T& lhs, const T& rhs)
Assumes that the initial value yields the identity element for binary functor.
| Galois::GReducible< T, BinFunc >::GReducible | ( | const BinFunc & | f, | |
| const T & | initial | |||
| ) | [inline, explicit, protected] |
| Galois::GReducible< T, BinFunc >::GReducible | ( | const BinFunc & | f = BinFunc() |
) | [inline, explicit] |
| f | the binary functor acting as the reduction operator |
| T& Galois::GReducible< T, BinFunc >::reduce | ( | ) | [inline] |
Returns the final reduction value.
Only valid outside the parallel region.
| void Galois::GReducible< T, BinFunc >::reset | ( | ) | [inline] |
reset value
| void Galois::GReducible< T, BinFunc >::update | ( | const T & | rhs | ) | [inline] |
Updates the thread local value by applying the reduction operator to current and newly provided value.
Galois::Runtime::PerThreadStorage<T> Galois::GReducible< T, BinFunc >::m_data [protected] |
BinFunc Galois::GReducible< T, BinFunc >::m_func [protected] |
const T Galois::GReducible< T, BinFunc >::m_initial [protected] |
1.6.1