This class abstracts the semantics of a reduce skeleton by exposing only the necessary information in its representation. More...
Public Member Functions | |
reduce (Op const &op) | |
Op | get_op (void) const |
Public Types | |
using | skeleton_tag_type = tags::reduce< Tag > |
using | op_type = Op |
using | base_type = decltype(skeletons::binary_tree< Tag, Flows, Span >(std::declval< Op >())) |
This class abstracts the semantics of a reduce skeleton by exposing only the necessary information in its representation.
A reduce skeleton consists of a reducing the input to the closest power-of-two and then performing a reduction using a binary reduction tree on that. The reduction tree can have several shapes and one can modify its layout by specifying the Tag
parameter.
This abstraction not only makes the reconstruction of a reduce skeleton easier, but also provides access to the underlying operation in the reduce skeleton. Furthermore, it reduces the symbol size for a reduce skeleton, hence, reducing the total compilation time.
Op | the operation to be used while reducing the input. |
Flows | the flow to be used between the levels of the reduction tree. |
Span | the iteration space for the elements in each level of both the reduction to power-of-two and the reduction tree. |
Tag | determines the type of reduction to be used. |