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::repeat< S, SizeF, Flows > Class Template Reference

A repeat skeleton spawns a single skeleton for the number of times specified by SizeF. More...

Public Member Functions

 repeat (S const &skeleton, SizeF const &size_functor)
 
nested_p_type nested_skeleton () const
 returns underlying skeleton to be repeated
 
in_port_type in_port (std::size_t id_offset) const
 maps the input port of repeated skeleton More...
 
template<typename In >
out_port_type< In >::type out_port (In const &in, std::size_t id_offset) const
 maps the output port of repeated skeleton More...
 
std::size_t lid_offset (std::size_t repeat_lid_offset, std::size_t iter_num) const
 calculate the offset of underlying skeleton based on repeat offset and current iteration number More...
 
nested_p_type::in_port_type nested_in_port (std::size_t repeat_lid_offset, std::size_t iter_num) const
 maps the in port of current underlying skeleton based on the the offset of repeat and iteration number More...
 
template<typename In >
nested_p_type::template out_port_type< In >::type nested_out_port (In const &in, std::size_t repeat_lid_offset, std::size_t iter_num) const
 maps the out port of current underlying skeleton based on the the offset of repeat and iteration number More...
 
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. It computes its own size by passing the underlying skeleton's size to the SizeF More...
 
dims_type dimensions () const
 
std::size_t last_id () const
 last_id is the maximum task id that this skeleton will create
 
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=0)
 A repeat skeleton starts the spawning process by spawning one iteration at a time and with the help of the flows given it redirects input and outputs in between the iterations. It continues the spawning process for the number of times given by SizeF. More...
 

Public Types

using dims_type = std::size_t
 
using nested_p_type = S
 
using index_type = typename S::index_type
 
using ports_t = typename Flows::template port_types< repeat >
 
using in_port_type = typename ports_t::in_port_type
 
using skeleton_tag_type = tags::unnamed_skeleton
 

Static Public Attributes

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

Detailed Description

template<typename S, typename SizeF, typename Flows>
class stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >

A repeat skeleton spawns a single skeleton for the number of times specified by SizeF.

Template Parameters
Sthe enclosed skeleton that will be spawned for SizeF times
SizeFa size functor used to determine number of iterations
Flowsspecifies the high-level flow dependencies for this repeat skeleton

Example - A simple repeat skeleton with piped flow:

dot_inline_dotgraph_15.png

Member Function Documentation

◆ in_port()

template<typename S , typename SizeF , typename Flows >
in_port_type stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >::in_port ( std::size_t  id_offset) const

maps the input port of repeated skeleton

Parameters
id_offsetoffset of repeat skeleton

◆ out_port()

template<typename S , typename SizeF , typename Flows >
template<typename In >
out_port_type<In>::type stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >::out_port ( In const &  in,
std::size_t  id_offset 
) const

maps the output port of repeated skeleton

Template Parameters
Inin flow type
Parameters
id_offsetoffset of repeat skeleton

◆ lid_offset()

template<typename S , typename SizeF , typename Flows >
std::size_t stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >::lid_offset ( std::size_t  repeat_lid_offset,
std::size_t  iter_num 
) const

calculate the offset of underlying skeleton based on repeat offset and current iteration number

Parameters
repeat_lid_offsetoffset of repeat skeleton
iter_numcurrent iteration number

◆ nested_in_port()

template<typename S , typename SizeF , typename Flows >
nested_p_type::in_port_type stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >::nested_in_port ( std::size_t  repeat_lid_offset,
std::size_t  iter_num 
) const

maps the in port of current underlying skeleton based on the the offset of repeat and iteration number

Parameters
repeat_lid_offsetoffset of repeat skeleton
iter_numcurrent iteration number

◆ nested_out_port()

template<typename S , typename SizeF , typename Flows >
template<typename In >
nested_p_type::template out_port_type<In>::type stapl::skeletons::skeletons_impl::repeat< S, SizeF, Flows >::nested_out_port ( In const &  in,
std::size_t  repeat_lid_offset,
std::size_t  iter_num 
) const

maps the out port of current underlying skeleton based on the the offset of repeat and iteration number

Template Parameters
Inin flow type
Parameters
repeat_lid_offsetoffset of repeat skeleton
iter_numcurrent iteration number

◆ set_dimensions()

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

sets the underlying skeleton sizes based on the given tuple of view sizes. It computes its own size by passing the underlying skeleton's size to the SizeF

Parameters
spawnerthe spawner which is spawning this skeleton.
viewsthe views which are passed to the skeleton.

◆ spawn()

template<typename S , typename SizeF , typename Flows >
template<typename Spawner , typename Coord , typename In , typename Out >
bool stapl::skeletons::skeletons_impl::repeat< S, SizeF, 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 = 0 
)

A repeat skeleton starts the spawning process by spawning one iteration at a time and with the help of the flows given it redirects input and outputs in between the iterations. It continues the spawning process for the number of times given by SizeF.

Similar to the other composite skeletons, a repeat skeleton can pause the spawning process and continue later on.

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 iteration number of the repetition
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: