STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Static Public Attributes
stapl::skeletons::skeletons_impl::compose< Skeletons, Flows > Class Template Reference

Compose operator groups the given skeletons together and performs the spawning process in the order of composition (P0, P1, ... Pn). The spawning process starts from the first skeleton (P0) and continues until the last skeleton(Pn) is spawned. More...

Public Member Functions

 compose (Skeletons skeletons)
 
 compose (compose const &other)=default
 
 compose (compose &&other)=default
 
dims_type dimensions () const
 
template<typename Spawner , typename... Views>
void set_dimensions (Spawner const &spawner, Views const &... views)
 sets the underlying skeleton sizes based on the given tuple of view sizes, and considers its own size as two (LeftP and RightP) More...
 
template<std::size_t up_to>
std::size_t lid_offset (std::size_t compose_lid_offset) const
 computes the id offset of a skeleton with the index up_to. More...
 
std::size_t last_id () const
 
template<std::size_t N>
auto get_skeleton () const STAPL_AUTO_RETURN((stapl
 Return the input port of the skeleton at index i and gives it an offset of id_offset. More...
 
template<typename State , typename... Args>
State spawn_skeletons (std::integral_constant< int, 0 >, State const &state, Args &&... args)
 
template<int i, typename State , typename... Args>
State spawn_skeletons (std::integral_constant< int, i >, State const &state, Args &&... args)
 
template<typename Spawner , typename Coord , typename In , typename Out >
bool spawn (Spawner &spawner, std::size_t lid_offset, Coord const &skeleton_size, Coord const &coord, In const &in, Out const &out, std::size_t cur_stage)
 A compose skeleton starts the spawning process by spawning first the LeftP and then followed by spawning the RightP. If spawning of the LeftP is not finished (returned false). The spawning of the RightP would not start immediately. More...
 

Public Types

using dims_type = std::size_t
 
using index_type = typename stapl::tuple_element< 0, Skeletons >::type::index_type
 
using skeletons_size = std::integral_constant< int, stapl::tuple_size< Skeletons >::value >
 
using skeletons_type = Skeletons
 
using ports_t = typename Flows::template port_types< compose >
 
using in_port_type = typename ports_t::in_port_type
 
using skeleton_tag_type = tags::unnamed_skeleton
 
using flows_t = Flows
 

Static Public Attributes

static constexpr std::size_t in_port_size = ports_t::in_port_size
 

Detailed Description

template<typename Skeletons, typename Flows>
class stapl::skeletons::skeletons_impl::compose< Skeletons, Flows >

Compose operator groups the given skeletons together and performs the spawning process in the order of composition (P0, P1, ... Pn). The spawning process starts from the first skeleton (P0) and continues until the last skeleton(Pn) is spawned.

By default skeletons in a compose are connected to their successors, (flows::compose_flows::piped) which is known as a pipeline in other contexts. This behavior can be modified by using custom Flows.

Example - A simple compose with default piped flow:

dot_inline_dotgraph_12.png
See also
flows::compose_flows

Member Function Documentation

◆ set_dimensions()

template<typename Skeletons , typename Flows >
template<typename Spawner , typename... Views>
void stapl::skeletons::skeletons_impl::compose< Skeletons, Flows >::set_dimensions ( Spawner const &  spawner,
Views const &...  views 
)

sets the underlying skeleton sizes based on the given tuple of view sizes, and considers its own size as two (LeftP and RightP)

Parameters
spawnerthe spawner which is spawning this skeleton.
view_domainsa tuple of view domains.

◆ lid_offset()

template<typename Skeletons , typename Flows >
template<std::size_t up_to>
std::size_t stapl::skeletons::skeletons_impl::compose< Skeletons, Flows >::lid_offset ( std::size_t  compose_lid_offset) const

computes the id offset of a skeleton with the index up_to.

The id offset is used in may places, such as various compose flows.

See also
flows::compose_flows

◆ get_skeleton()

template<typename Skeletons , typename Flows >
template<std::size_t N>
auto stapl::skeletons::skeletons_impl::compose< Skeletons, Flows >::get_skeleton ( ) const

Return the input port of the skeleton at index i and gives it an offset of id_offset.

Return the output port of the skeleton at index i and gives it an offset of id_offset

◆ spawn()

template<typename Skeletons , typename Flows >
template<typename Spawner , typename Coord , typename In , typename Out >
bool stapl::skeletons::skeletons_impl::compose< Skeletons, Flows >::spawn ( Spawner &  spawner,
std::size_t  lid_offset,
Coord const &  skeleton_size,
Coord const &  coord,
In const &  in,
Out const &  out,
std::size_t  cur_stage 
)

A compose skeleton starts the spawning process by spawning first the LeftP and then followed by spawning the RightP. If spawning of the LeftP is not finished (returned false). The spawning of the RightP would not start immediately.

Parameters
spawneris used for spawning the enclosed skeleton for the given number of times by SizeF
lid_offsetthe safe id to start the spawning from
skeleton_sizethe size of skeletons enclosing this skeleton
coordthe coordinate of this skeleton in the evaluated skeletons coordinate space
inthe input flow passed to this skeleton
outthe output flow that this skeleton would produce its results for
cur_stagecurrent state of the compose skeleton
Returns
true if spawning of last iteration is finished
See also
repeat.hpp
spawner.hpp

The documentation for this class was generated from the following file: