In a data parallel operation involving N threads of a rope, the threads can participate in a type-specific reduction. As discussed above each rope object has the skeleton of a tree-based reduction operation. The threads in a rope can enter type-specific reductions by cloning this reduction skeleton to a reduction object for that type. To achieve this Coir<Futures> defines a ReductionT template class parameterized on the type of the value the threads contribute to a reduction operation. This class is defined as follows :
template <class T, class ReducerType= binary_function<T,T, T> >
class ReductionT
{
public:
typedef ReducerType reducer_type;
typedef T data_type;
ReductionT(Reduction& my_red
= Rope::SelfRope().ReductionObj());
ReductionT();
// reduction operator
T operator()(reducer_type reducer,
const T& data);
};