FreePOOMA
2.4.1
|
This reduction is the one that gets called for a data-parallel expression. More...
#include <Reduction.h>
Public Member Functions | |
Reduction () | |
~Reduction () | |
template<class T , class Op , class Cond , class Expr > | |
void | evaluate (T &ret, const Op &op, const WhereProxy< Cond, Expr > &w) const |
Un-wrap where() expression operation and pass on to generic evaluator. | |
template<class T , class Op , class Expr > | |
void | evaluate (T &ret, const Op &op, const Expr &e) const |
Input an expression and cause it to be reduced. | |
Static Public Member Functions | |
template<class Expr > | |
static bool | checkValidity (const Expr &e, WrappedInt< false >) |
Helper to check validity of the expression, general version. | |
template<class Expr > | |
static bool | checkValidity (const Expr &e, WrappedInt< true >) |
Helper to check validity of the expression, version for fields. |
This reduction is the one that gets called for a data-parallel expression.
It just determines the appropriate reduction from the types of the LHS and RHS. We don't need to do a blockAndEvaluate() because all reductions naturally involve some sort of blocking using counting semaphores. This approach is superior to blockAndEvaluate() because iterates not related to the reduction can continue to execute out-of-order.
Reduction< MainEvaluatorTag >::Reduction | ( | ) | [inline] |
Reduction< MainEvaluatorTag >::~Reduction | ( | ) | [inline] |
static bool Reduction< MainEvaluatorTag >::checkValidity | ( | const Expr & | e, |
WrappedInt< false > | |||
) | [inline, static] |
Helper to check validity of the expression, general version.
static bool Reduction< MainEvaluatorTag >::checkValidity | ( | const Expr & | e, |
WrappedInt< true > | |||
) | [inline, static] |
Helper to check validity of the expression, version for fields.
void Reduction< MainEvaluatorTag >::evaluate | ( | T & | ret, |
const Op & | op, | ||
const WhereProxy< Cond, Expr > & | w | ||
) | const [inline] |
Un-wrap where() expression operation and pass on to generic evaluator.
References WhereProxy< F, B >::opMask(), and WhereProxy< F, B >::whereMask().
void Reduction< MainEvaluatorTag >::evaluate | ( | T & | ret, |
const Op & | op, | ||
const Expr & | e | ||
) | const [inline] |
Input an expression and cause it to be reduced.
We just pass the buck to a special reduction after updating the expression leafs and checking its validity (we can handle one subfield only).
References forEach(), PAssert, and POOMA_INCREMENT_STATISTIC.