STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Namespaces | Modules | Functions
Compositional Operators

Compositional operators allow new skeletons to be defined from existing skeletons. More...

+ Collaboration diagram for Compositional Operators:

Namespaces

 stapl::skeletons::result_of
 A compose operator puts a series of skeletons one after another. With the help of various compose_flows, one can customize the way these skeletons are connected. The most common flow for the compose operator is a piped flow. In fact, a compose with a piped flow is known as a pipeline in the literature.
 

Modules

 Producer-Consumer
 
 Compositional Operators Internal
 

Functions

template<typename Flows , typename ... S>
result_of::compose< Flows, stapl::tuple< typename std::decay< S >::type... > > stapl::skeletons::compose (S &&... skeleton)
 A compose operator is similar to the functional composition used in functional programming. However, it allows the customization of composition through the given Flows parameter. More...
 
template<typename ... S>
result_of::compose< stapl::use_default, stapl::tuple< typename std::decay< S >::type... > > stapl::skeletons::compose (S &&... skeleton)
 A specialization for the functional composition style compose operator. More...
 
template<typename Flows = stapl::use_default, typename Body , typename Reduce , typename ContCond >
result_of::do_while< Flows, Body, Reduce, ContCond > stapl::skeletons::do_while (Body &&body_skeleton, Reduce &&reduce_skeleton, ContCond &&cont_cond)
 A do while skeleton is used when a loop with dynamically determined condition is required. After each iteration the loop condition provided by cont_cond is evaluated and loop will continue or stop based on the input to the cont_cond. More...
 
template<typename Span = stapl::use_default, typename Flows = stapl::use_default, typename PD >
result_of::elem< Span, Flows, PD > stapl::skeletons::elem (PD &&pd, Span &&span)
 An elementary is an operator that converts parametric dependencies to skeletons. It wraps a parametric dependency with Flows and Span information. More...
 
template<typename Span = stapl::use_default, typename Flows = stapl::use_default, typename PD >
result_of::elem< Span, Flows, PD > stapl::skeletons::elem (PD &&pd)
 An overload when the span instance is not passed. More...
 
template<typename Flows = stapl::use_default, typename S , typename SizeF >
result_of::repeat< Flows, S, SizeF > stapl::skeletons::repeat (S &&skeleton, SizeF &&size_functor)
 Repeat skeleton repeats an enclosed skeleton for the lazy size provided by size_functor. You can see examples of its usage in tree, reverse_tree, butterfly, etc. More...
 

Detailed Description

Compositional operators allow new skeletons to be defined from existing skeletons.

Function Documentation

◆ compose() [1/2]

template<typename Flows , typename ... S>
result_of::compose< Flows, stapl::tuple<typename std::decay<S>::type...> > stapl::skeletons::compose ( S &&...  skeleton)

A compose operator is similar to the functional composition used in functional programming. However, it allows the customization of composition through the given Flows parameter.

The Flows parameter defines the input/output dependencies between the underlying skeletons without the knowledge of the computation. The default Flows is called piped in which the input/output dependencies are the same as the function composition compose(S1, S2, ... Sn) input = Sn(...(S1(input))).

Template Parameters
Flowsthe flows to be used for this compose operator. Some skeletons require customized flows for their computation. However, most of the compositions can use the default method of composition called piped. If tags::inline_flow is passed, then the flow type will be created based on annotations added to the skeleton parameters.
Parameters
skeletonskeletons to be composed.
Returns
a composition of the given skeletons with the given customized flows.
See also
flows::compose_flows::piped
flows::inline_flows::inline_flow

◆ compose() [2/2]

template<typename ... S>
result_of::compose< stapl::use_default, stapl::tuple<typename std::decay<S>::type...> > stapl::skeletons::compose ( S &&...  skeleton)

A specialization for the functional composition style compose operator.

Parameters
skeletonskeletons to be composed.

◆ do_while()

template<typename Flows = stapl::use_default, typename Body , typename Reduce , typename ContCond >
result_of::do_while<Flows, Body, Reduce, ContCond> stapl::skeletons::do_while ( Body &&  body_skeleton,
Reduce &&  reduce_skeleton,
ContCond &&  cont_cond 
)

A do while skeleton is used when a loop with dynamically determined condition is required. After each iteration the loop condition provided by cont_cond is evaluated and loop will continue or stop based on the input to the cont_cond.

Template Parameters
Flowsthe flow to be used for the do-while. By default, a do_while_flows::piped is used.
Parameters
body_skeletonthe body skeleton is the body of each iteration
reduce_skeletonthe reduction skeleton is used to compute the condition of the loop
cont_condthe condition functor to be used in order to determine if the loop continues or stops
Returns
a do while skeleton
See also
do_while_pd

◆ elem() [1/2]

template<typename Span = stapl::use_default, typename Flows = stapl::use_default, typename PD >
result_of::elem<Span, Flows, PD> stapl::skeletons::elem ( PD &&  pd,
Span &&  span 
)

An elementary is an operator that converts parametric dependencies to skeletons. It wraps a parametric dependency with Flows and Span information.

Template Parameters
Spanthe iteration space for elements in this elementary. The default span is balanced
Flowsthe flow to be used for the elementary skeleton. The default flow is a forked flow
Parameters
pdthe parametric dependency to be wrapped
Returns
an elementary skeleton
See also
flows::elem_f::forked
spans::balanced

◆ elem() [2/2]

template<typename Span = stapl::use_default, typename Flows = stapl::use_default, typename PD >
result_of::elem<Span, Flows, PD> stapl::skeletons::elem ( PD &&  pd)

An overload when the span instance is not passed.

Template Parameters
Spanthe iteration space for elements in this elementary. The default span is balanced
Flowsthe flow to be used for the elementary skeleton. The default flow is a forked flow
Parameters
pdthe parametric dependency to be wrapped
Returns
an elementary skeleton
See also
flows::elem_f::forked
spans::balanced

◆ repeat()

template<typename Flows = stapl::use_default, typename S , typename SizeF >
result_of::repeat<Flows, S, SizeF> stapl::skeletons::repeat ( S &&  skeleton,
SizeF &&  size_functor 
)

Repeat skeleton repeats an enclosed skeleton for the lazy size provided by size_functor. You can see examples of its usage in tree, reverse_tree, butterfly, etc.

Template Parameters
Flowsthe flow to be used for the repeat. The default flow for a repeat skeleton is piped
Parameters
skeletonthe enclosed skeleton to be repeated
size_functorthe size of a repeat skeleton is not known until the input size is known. This parameter is a functor that given the input size determines the number of iterations of this repeat skeleton
Returns
a repeat skeleton with a given lazy size functor
See also
skeletons_impl::repeat
flows::repeat_flows::piped