Galois::GReducible< T, BinFunc > Class Template Reference

GReducible stores per thread values of a variable of type T. More...

#include <Accumulator.h>

Inheritance diagram for Galois::GReducible< T, BinFunc >:
GaloisRuntime::ThreadAware

List of all members.

Public Member Functions

 GReducible (const T &val)
 GReducible (BinFunc F)
 GReducible (const T val, BinFunc F)
 GReducible ()
const T & update (const T &_newVal)
 updates the thread local value by applying the reduction operator to current and newly provided value
T & get ()
 returns the thread local value if in a parallel loop or the final reduction if in serial mode
void reset (const T &d)
 reset thread local value to the arg provided

Private Member Functions

void reduce ()
virtual void ThreadChange (bool starting)

Private Attributes

BinFunc _func
GaloisRuntime::PerCPU< T > _data

Detailed Description

template<typename T, typename BinFunc>
class Galois::GReducible< T, BinFunc >

GReducible stores per thread values of a variable of type T.

At the end of a for_each section, the final value is obtained by performing a reduction on per thread values using the provided binary functor BinFunc


Constructor & Destructor Documentation

template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible ( const T &  val  )  [inline, explicit]
Parameters:
val initial per thread value
template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible ( BinFunc  F  )  [inline, explicit]
Parameters:
F the binary functor acting as the reduction operator
template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible ( const T  val,
BinFunc  F 
) [inline]
Parameters:
val initial per thread value
F the binary functor acting as the reduction operator
template<typename T, typename BinFunc>
Galois::GReducible< T, BinFunc >::GReducible (  )  [inline]

Member Function Documentation

template<typename T, typename BinFunc>
T& Galois::GReducible< T, BinFunc >::get (  )  [inline]

returns the thread local value if in a parallel loop or the final reduction if in serial mode

template<typename T, typename BinFunc>
void Galois::GReducible< T, BinFunc >::reduce (  )  [inline, private]
template<typename T, typename BinFunc>
void Galois::GReducible< T, BinFunc >::reset ( const T &  d  )  [inline]

reset thread local value to the arg provided

Parameters:
d 
template<typename T, typename BinFunc>
virtual void Galois::GReducible< T, BinFunc >::ThreadChange ( bool  starting  )  [inline, private, virtual]
template<typename T, typename BinFunc>
const T& Galois::GReducible< T, BinFunc >::update ( const T &  _newVal  )  [inline]

updates the thread local value by applying the reduction operator to current and newly provided value

Parameters:
_newVal 

Member Data Documentation

template<typename T, typename BinFunc>
GaloisRuntime::PerCPU<T> Galois::GReducible< T, BinFunc >::_data [private]
template<typename T, typename BinFunc>
BinFunc Galois::GReducible< T, BinFunc >::_func [private]

The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:29 2011 for Galois by  doxygen 1.6.3