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

This parametric dependency is used in farms skeleton to generate the initial seeds of computation. More...

Public Member Functions

 farm_pd (Generator generator)
 
template<typename Coord , typename Visitor , typename In >
void case_of (Coord const &, Coord const &coord, Visitor &visitor, In &&in_flow) const
 If coord is <idx, ...> it wraps the Op with the following inputs and sends it to the visitor along with the m_op. More...
 
template<typename Size , typename Coord , typename FlowIndex >
std::size_t consumer_count (Size const &, Coord const &, FlowIndex) const
 determines how many of the instances of this parametric dependency will be consuming from a producer with a given coordinate. This is a reverse query as compared to case_of More...
 
op_type get_op () const
 
template<typename Coord >
int get_result_id (Coord const &, Coord const &) const
 
template<typename Coord , typename Span >
void configure (Coord &&, Span &&)
 

Public Types

using op_type = farm_init< Generator >
 

Public Attributes

op_type m_op
 

Static Public Attributes

static constexpr std::size_t in_port_size = 1
 
static constexpr std::size_t op_arity = 1
 

Detailed Description

template<typename Generator>
class stapl::skeletons::skeletons_impl::farm_pd< Generator >

This parametric dependency is used in farms skeleton to generate the initial seeds of computation.

This parametric dependency is similar to the zip parametric dependency, except it sends a farm_stub to the user-provided generator as well.

Example - the inputs to a spawned element created by this skeleton would be:

Template Parameters
Opthe workfunction to be applied on each element
ithe number of input flows
See also
zip

Member Function Documentation

◆ case_of()

template<typename Generator >
template<typename Coord , typename Visitor , typename In >
void stapl::skeletons::skeletons_impl::farm_pd< Generator >::case_of ( Coord const &  ,
Coord const &  coord,
Visitor &  visitor,
In &&  in_flow 
) const

If coord is <idx, ...> it wraps the Op with the following inputs and sends it to the visitor along with the m_op.

  • in<0>[idx]
  • in<1>[idx]
  • ...
Parameters
coord<i, j, k, ...> where i < n, j < m, k < p
visitorthe information about Op and input is passed so that later this information can be converted to a node in the dependence graph
in_flowa tuple of input flows to consume from

◆ consumer_count()

template<typename Generator >
template<typename Size , typename Coord , typename FlowIndex >
std::size_t stapl::skeletons::skeletons_impl::farm_pd< Generator >::consumer_count ( Size const &  ,
Coord const &  ,
FlowIndex   
) const

determines how many of the instances of this parametric dependency will be consuming from a producer with a given coordinate. This is a reverse query as compared to case_of

Template Parameters
FlowIndexthe flow index to which this request is sent

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