STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Functions
+ Collaboration diagram for Functional Definition of:

Functions

template<typename Tag = tags::binomial, typename Op >
result_of::scan< tags::scan< Tag, tags::inclusive >, Op > stapl::skeletons::scan (Op &&op)
 A scan skeleton which is specialized based on the tag given.
 
template<typename Tag = tags::blelloch, typename Op , typename T >
result_of::scan< tags::scan< Tag, tags::exclusive >, Op > stapl::skeletons::scan (Op &&op, T const &initial_value)
 In an exclusive scan each element in the result is the result of the cumulative operation on all elements before it. More...
 
template<typename ValueType , typename Tag = tags::binomial, typename Op >
result_of::scan_reduce< ValueType, Tag, tags::inclusive, Op > stapl::skeletons::scan_reduce (Op &&op)
 This skeleton combines the functionality of inclusive_scan skeleton and reduce_to_locs skeletons. More...
 
template<typename ValueType , typename Tag = tags::blelloch, typename Op >
result_of::scan_reduce< ValueType, Tag, tags::exclusive, Op > stapl::skeletons::scan_reduce (Op &&op, ValueType const &initial_value)
 This skeleton combines the functionality of exclusive_scan skeleton and reduce_to_locs skeletons. More...
 

Detailed Description

Algorithms as Skeletons

Function Documentation

◆ scan()

template<typename Tag = tags::blelloch, typename Op , typename T >
result_of::scan<tags::scan<Tag, tags::exclusive>, Op> stapl::skeletons::scan ( Op &&  op,
T const &  initial_value 
)

In an exclusive scan each element in the result is the result of the cumulative operation on all elements before it.

For example, if + is used as the operation, each element in the output is the sum of all elements before it, and the first element is the neutral value. An exclusive scan of [1, 2, 3, 4, ...] would be [0, 1, 3, 6, 10, ...].

Parameters
opthe operation to be used to compute the scan results
initial_valuethe value for the first element of the output
Template Parameters
Tagthe type of exclusive scan to be used
Returns
an exclusive scan specified by the Tag
See also
exclusive_scan

◆ scan_reduce() [1/2]

template<typename ValueType , typename Tag = tags::binomial, typename Op >
result_of::scan_reduce<ValueType, Tag, tags::inclusive, Op> stapl::skeletons::scan_reduce ( Op &&  op)

This skeleton combines the functionality of inclusive_scan skeleton and reduce_to_locs skeletons.

This skeleton is useful in cases when we both need the result of scan over the inputs and the reduction of input values. It avoids doing an extra iteration over the data.

Parameters
opthe operation to be used to compute the scan results
Template Parameters
Tagthe type of exclusive scan to be used
Returns
an exclusive scan specified by the Tag
See also
inclusive_scan
scan
reduce_to_locs

◆ scan_reduce() [2/2]

template<typename ValueType , typename Tag = tags::blelloch, typename Op >
result_of::scan_reduce<ValueType, Tag, tags::exclusive, Op> stapl::skeletons::scan_reduce ( Op &&  op,
ValueType const &  initial_value 
)

This skeleton combines the functionality of exclusive_scan skeleton and reduce_to_locs skeletons.

This skeleton is useful in cases when we both need the result of scan over the inputs and the reduction of input values. It avoids doing an extra iteration over the data.

Parameters
opthe operation to be used to compute the scan results
initial_valuethe value for the first element of the output
Template Parameters
Tagthe type of exclusive scan to be used
Returns
an exclusive scan specified by the Tag
See also
exclusive_scan
scan
reduce_to_locs