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

Functions

template<typename T , typename Tag = stapl::use_default, typename Span = stapl::use_default>
skeletons::result_of::allgather< T, Tag, Span > stapl::skeletons::allgather (void)
 Allgather skeleton is a function of type [[T]]->[[T]] which is defined using allreduce with a concatenation operator. More...
 
template<typename Tag = stapl::use_default, typename Span = stapl::use_default, typename Op >
skeletons::result_of::allreduce< Tag, Span, Op > stapl::skeletons::allreduce (Op &&reduce_op)
 This all reduce skeleton consists of a reduction phase and a broadcast phase. You can use various types of reduce and broadcast for this skeleton by specifying a tag. Your tag can be one of, but not limited to, the following tags: More...
 
template<typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, bool isComplete = false, typename Op >
result_of::binary_tree< Tag, Flows, Span, isComplete, Op > stapl::skeletons::binary_tree (Op &&op)
 A binary tree used in many algorithms including but not limited to reduction, and prefix scan. More...
 
template<typename T , typename Tag = stapl::use_default, typename Span = stapl::use_default>
result_of::gather< T, Tag, Span > stapl::skeletons::gather (void)
 Allgather skeleton is a function of type [[T]]->[[T]] which is defined using allreduce with a concatenation operator. More...
 
template<typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, typename Op >
result_of::reduce< Tag, Flows, Span, Op > stapl::skeletons::reduce (Op &&op)
 A reduce skeleton is used in many algorithms, e.g., reduction, allreduce, scan, etc. This skeleton is a tree of reduce parametric dependency. The type of the tree, span, and the parametric dependency to be used in this skeleton is determined by the given tag. A few examples of reduce skeleton variations are when the following tags are used: More...
 
template<bool SetResult = false, typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, typename Op >
result_of::reduce_to_locs< Tag, Flows, Span, Op, SetResult > stapl::skeletons::reduce_to_locs (Op &&op)
 A reduce to location skeleton is used to obtain the reduced value of an input/computation on every locations. More...
 
template<typename Span = stapl::use_default, typename Op >
result_of::reduce_to_pow_two< Span, Op > stapl::skeletons::reduce_to_pow_two (Op &&op)
 This skeleton is used as the pre-processing phase of various skeletons including reduce, n-partition, etc. Basically, this skeleton tries to prepare the input for a pow-two based skeleton. More...
 
template<bool SetResult = false, typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, bool isComplete = false, bool isPositionAware = false, typename Op , typename Filter = skeletons::no_filter>
result_of::reverse_binary_tree< Tag, Flows, Span, isComplete, isPositionAware, Op, Filter, SetResult > stapl::skeletons::reverse_binary_tree (Op &&op, Filter &&filter=Filter())
 A reverse binary tree used in many other skeletons such as broadcast. More...
 

Detailed Description

Reduce-based Skeletons

Function Documentation

◆ allgather()

template<typename T , typename Tag = stapl::use_default, typename Span = stapl::use_default>
skeletons::result_of::allgather<T, Tag, Span> stapl::skeletons::allgather ( void  )

Allgather skeleton is a function of type [[T]]->[[T]] which is defined using allreduce with a concatenation operator.

An allgather skeleton gathers data from all partitions and distributes the combined data to all partitions.

Template Parameters
Ttype of the element used in allgather
Spanthe span to be used for reduce and broadcast skeletons
Parameters
tagdetermines the type of allgather skeleton

◆ allreduce()

template<typename Tag = stapl::use_default, typename Span = stapl::use_default, typename Op >
skeletons::result_of::allreduce<Tag, Span, Op> stapl::skeletons::allreduce ( Op &&  reduce_op)

This all reduce skeleton consists of a reduction phase and a broadcast phase. You can use various types of reduce and broadcast for this skeleton by specifying a tag. Your tag can be one of, but not limited to, the following tags:

  • tags::right_aligned - which will use right-aligned reduce and broadcast
  • tags::left_aligned - which will use left-aligned reduce and broadcast
  • stapl::use_default - which will use the default reduce and broadcast
Parameters
reduce_opthe operation to be used for reduction
tagdetermines which type of reduce and broadcast should be used
Template Parameters
Spanthe span to be used for reduce and broadcast skeletons

◆ binary_tree()

template<typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, bool isComplete = false, typename Op >
result_of::binary_tree<Tag, Flows, Span, isComplete, Op> stapl::skeletons::binary_tree ( Op &&  op)

A binary tree used in many algorithms including but not limited to reduction, and prefix scan.

A binary tree can be created in various ways based on the tag provided to it:

  • tags::left_aligned a left aligned binary tree with a left aligned binary_tree_pd
  • tags::right_aligned a right aligned binary tree with a right aligned binary_tree_pd
  • stapl::use_default a default binary tree with default binary_tree_pd is used.
Template Parameters
Spanthe iteration space for the elements in the reduction tree
Flowsthe flow to be used for this skeleton
Parameters
opthe operation (an element-wise binary functor) to be used in each binary_tree_pd
tagdetermines the type of span and binary_tree_pd to be used
Returns
a binary tree skeleton with a tag-determined parametric dependency
See also
tree

◆ gather()

template<typename T , typename Tag = stapl::use_default, typename Span = stapl::use_default>
result_of::gather<T, Tag, Span> stapl::skeletons::gather ( void  )

Allgather skeleton is a function of type [[T]]->[[T]] which is defined using allreduce with a concatenation operator.

An gather skeletons, gathers data from all partitions and distributes the combined data to all partitions.

Template Parameters
Ttype of the element used in gather
Spanthe span to be used for reduce and broadcast skeletons
Parameters
tagdetermines the type of gather skeleton

◆ reduce()

template<typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, typename Op >
result_of::reduce<Tag, Flows, Span, Op> stapl::skeletons::reduce ( Op &&  op)

A reduce skeleton is used in many algorithms, e.g., reduction, allreduce, scan, etc. This skeleton is a tree of reduce parametric dependency. The type of the tree, span, and the parametric dependency to be used in this skeleton is determined by the given tag. A few examples of reduce skeleton variations are when the following tags are used:

  • tags::left_aligned a left aligned reduce tree with a left aligned reduce parametric dependency
  • tags::right_aligned a right aligned reduce tree with a right aligned reduce parametric dependency
  • stapl::use_default a default reduce tree with default reduce parametric dependency is used.
Note
This reduction implementation assumes that the reduction operation is both associative and commutative.
Template Parameters
Spanthe iteration space for the elements in the reduction tree
Flowsthe flow to be used for this skeleton
Parameters
opthe operation (an element-wise binary functor) to be used in each reduce parametric dependency
tagdetermines the type of span and reduce parametric dependency to be used
Returns
a reduce skeleton with a tag-determined parametric dependency
See also
tree

◆ reduce_to_locs()

template<bool SetResult = false, typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, typename Op >
result_of::reduce_to_locs<Tag, Flows, Span, Op, SetResult> stapl::skeletons::reduce_to_locs ( Op &&  op)

A reduce to location skeleton is used to obtain the reduced value of an input/computation on every locations.

This skeleton is obtained by putting a reduce skeleton and a broadcast_to_loc skeleton together. This skeleton can be used with all left-aligned reduce and broadcast skeletons.

Template Parameters
SetResultwhether the skeleton should set the task results on the pg edge container or not
Tagdetermines the type of span and reduce parametric dependency to be used
Flowsthe flows to be used in the reduction skeleton iterations
Spanthe iteration space for the elements in the reduction tree
Parameters
opthe operation (an element-wise binary functor) to be used in each reduce parametric dependency
Returns
a reduce skeleton with a tag-determined parametric dependency
See also
tree

◆ reduce_to_pow_two()

template<typename Span = stapl::use_default, typename Op >
result_of::reduce_to_pow_two<Span, Op> stapl::skeletons::reduce_to_pow_two ( Op &&  op)

This skeleton is used as the pre-processing phase of various skeletons including reduce, n-partition, etc. Basically, this skeleton tries to prepare the input for a pow-two based skeleton.

Parameters
opthe operation to be used in order to reduce the input size to the closest pow-of-two size
Template Parameters
Spanthe inner span on which the reduce_to_pow_two should be defined
Returns
a reduce to power two skeleton with given span and operation
See also
reduce

◆ reverse_binary_tree()

template<bool SetResult = false, typename Tag = stapl::use_default, typename Flows = stapl::use_default, typename Span = stapl::use_default, bool isComplete = false, bool isPositionAware = false, typename Op , typename Filter = skeletons::no_filter>
result_of::reverse_binary_tree< Tag, Flows, Span, isComplete,isPositionAware, Op, Filter, SetResult> stapl::skeletons::reverse_binary_tree ( Op &&  op,
Filter &&  filter = Filter() 
)

A reverse binary tree used in many other skeletons such as broadcast.

A reverse binary tree can be created in various ways based on the tag provided to it:

  • tags::left_aligned a left aligned reverse binary tree with a left aligned reverse_binary_tree_pd
  • tags::right_aligned a right aligned reverse binary tree with a right aligned reverse_binary_tree_pd
  • stapl::use_default a default reverse binary tree with default reverse_binary_tree_pd is used.
Template Parameters
SetResultwhether the skeleton should set the task results on the pg edge container or not
Tagdetermines the type of span and reverse_binary_tree_pd to be used reduction tree
Flowsthe flow to be used for this skeleton
Spanthe iteration space for the elements in the
isPositionAwarewhether the op needs to know the position of the node in the dependence graph or not
Parameters
opthe operation (an element-wise binary functor) to be used in each reverse_binary_tree_pd
Returns
a reverse binary tree skeleton with a tag-determined parametric dependency
See also
tree