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 |
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:
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
)
spawner | the spawner which is spawning this skeleton. |
view_domains | a tuple of view domains. |
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.
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
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.
spawner | is used for spawning the enclosed skeleton for the given number of times by SizeF |
lid_offset | the safe id to start the spawning from |
skeleton_size | the size of skeletons enclosing this skeleton |
coord | the coordinate of this skeleton in the evaluated skeletons coordinate space |
in | the input flow passed to this skeleton |
out | the output flow that this skeleton would produce its results for |
cur_stage | current state of the compose skeleton |