Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
streaming_node< tuple< Ports... >, JP, StreamFactory > Class Template Reference

#include <_flow_graph_streaming_node.h>

Inheritance diagram for streaming_node< tuple< Ports... >, JP, StreamFactory >:
Collaboration diagram for streaming_node< tuple< Ports... >, JP, StreamFactory >:

Classes

class  args_storage
 
class  args_storage_base
 
class  device_selector
 
class  device_selector_base
 
class  device_selector_body
 
class  kernel_body
 
struct  wrap_to_async
 
struct  wrap_to_async< T, std::false_type >
 

Public Member Functions

template<typename DeviceSelector >
 streaming_node (graph &g, const kernel_type &kernel, DeviceSelector d, StreamFactory &f)
 
 streaming_node (const streaming_node &node)
 
 streaming_node (streaming_node &&node)
 
 ~streaming_node ()
 
template<typename... Args>
void set_args (Args &&... args)
 

Protected Types

typedef StreamFactory::device_type device_type
 
typedef StreamFactory::kernel_type kernel_type
 

Protected Member Functions

void reset_node (reset_flags=rf_reset_protocol) __TBB_override
 
- Protected Member Functions inherited from internal::kernel_executor_helper< StreamFactory, internal::streaming_node_traits< JP, StreamFactory, Ports... >::kernel_input_tuple >
void enqueue_kernel_impl (kernel_input_tuple &, StreamFactory &factory, device_type device, const kernel_type &kernel, Args &... args) const
 

Private Types

typedef internal::streaming_node_traits< JP, StreamFactory, Ports... >::input_tuple input_tuple
 
typedef internal::streaming_node_traits< JP, StreamFactory, Ports... >::output_tuple output_tuple
 
typedef internal::key_from_policy< JP >::type key_type
 
typedef internal::streaming_device_with_key< device_type, key_typedevice_with_key_type
 
typedef composite_node< input_tuple, output_tuplebase_type
 
typedef internal::make_sequence< NUM_INPUTS >::type input_sequence
 
typedef internal::make_sequence< NUM_OUTPUTS >::type output_sequence
 
typedef internal::streaming_node_traits< JP, StreamFactory, Ports... >::indexer_node_type indexer_node_type
 
typedef indexer_node_type::output_type indexer_node_output_type
 
typedef internal::streaming_node_traits< JP, StreamFactory, Ports... >::kernel_input_tuple kernel_input_tuple
 
typedef multifunction_node< indexer_node_output_type, kernel_input_tupledevice_selector_node
 
typedef multifunction_node< kernel_input_tuple, output_tuplekernel_multifunction_node
 

Private Member Functions

template<int... S>
base_type::input_ports_type get_input_ports (internal::sequence< S... >)
 
template<int... S>
base_type::output_ports_type get_output_ports (internal::sequence< S... >)
 
base_type::input_ports_type get_input_ports ()
 
base_type::output_ports_type get_output_ports ()
 
template<int N>
int make_Nth_edge ()
 
template<int... S>
void make_edges (internal::sequence< S... >)
 
void make_edges ()
 
template<typename... Args>
args_storage_base * make_args_storage (const args_storage_base &storage, Args &&... args) const
 
void notify_new_device (device_type d)
 
template<typename ... Args>
void enqueue_kernel (kernel_input_tuple &ip, StreamFactory &factory, device_type device, const kernel_type &kernel, Args &... args) const
 

Private Attributes

indexer_node_type my_indexer_node
 
device_selector_base * my_device_selector
 
device_selector_node my_device_selector_node
 
join_node< kernel_input_tuple, JP > my_join_node
 
kernel_multifunction_node my_kernel_node
 
args_storage_base * my_args_storage
 

Static Private Attributes

static const size_t NUM_INPUTS = tuple_size<input_tuple>::value
 
static const size_t NUM_OUTPUTS = tuple_size<output_tuple>::value
 

Detailed Description

template<typename... Ports, typename JP, typename StreamFactory>
class streaming_node< tuple< Ports... >, JP, StreamFactory >

Definition at line 305 of file _flow_graph_streaming_node.h.

Member Typedef Documentation

◆ base_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef composite_node<input_tuple, output_tuple> streaming_node< tuple< Ports... >, JP, StreamFactory >::base_type
private

Definition at line 319 of file _flow_graph_streaming_node.h.

◆ device_selector_node

template<typename... Ports, typename JP , typename StreamFactory >
typedef multifunction_node<indexer_node_output_type, kernel_input_tuple> streaming_node< tuple< Ports... >, JP, StreamFactory >::device_selector_node
private

Definition at line 329 of file _flow_graph_streaming_node.h.

◆ device_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef StreamFactory::device_type streaming_node< tuple< Ports... >, JP, StreamFactory >::device_type
protected

Definition at line 315 of file _flow_graph_streaming_node.h.

◆ device_with_key_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::streaming_device_with_key<device_type, key_type> streaming_node< tuple< Ports... >, JP, StreamFactory >::device_with_key_type
private

Definition at line 318 of file _flow_graph_streaming_node.h.

◆ indexer_node_output_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef indexer_node_type::output_type streaming_node< tuple< Ports... >, JP, StreamFactory >::indexer_node_output_type
private

Definition at line 327 of file _flow_graph_streaming_node.h.

◆ indexer_node_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::streaming_node_traits<JP, StreamFactory, Ports...>::indexer_node_type streaming_node< tuple< Ports... >, JP, StreamFactory >::indexer_node_type
private

Definition at line 326 of file _flow_graph_streaming_node.h.

◆ input_sequence

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::make_sequence<NUM_INPUTS>::type streaming_node< tuple< Ports... >, JP, StreamFactory >::input_sequence
private

Definition at line 323 of file _flow_graph_streaming_node.h.

◆ input_tuple

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::streaming_node_traits<JP, StreamFactory, Ports...>::input_tuple streaming_node< tuple< Ports... >, JP, StreamFactory >::input_tuple
private

Definition at line 311 of file _flow_graph_streaming_node.h.

◆ kernel_input_tuple

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::streaming_node_traits<JP, StreamFactory, Ports...>::kernel_input_tuple streaming_node< tuple< Ports... >, JP, StreamFactory >::kernel_input_tuple
private

Definition at line 328 of file _flow_graph_streaming_node.h.

◆ kernel_multifunction_node

template<typename... Ports, typename JP , typename StreamFactory >
typedef multifunction_node<kernel_input_tuple, output_tuple> streaming_node< tuple< Ports... >, JP, StreamFactory >::kernel_multifunction_node
private

Definition at line 330 of file _flow_graph_streaming_node.h.

◆ kernel_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef StreamFactory::kernel_type streaming_node< tuple< Ports... >, JP, StreamFactory >::kernel_type
protected

Definition at line 316 of file _flow_graph_streaming_node.h.

◆ key_type

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::key_from_policy<JP>::type streaming_node< tuple< Ports... >, JP, StreamFactory >::key_type
private

Definition at line 313 of file _flow_graph_streaming_node.h.

◆ output_sequence

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::make_sequence<NUM_OUTPUTS>::type streaming_node< tuple< Ports... >, JP, StreamFactory >::output_sequence
private

Definition at line 324 of file _flow_graph_streaming_node.h.

◆ output_tuple

template<typename... Ports, typename JP , typename StreamFactory >
typedef internal::streaming_node_traits<JP, StreamFactory, Ports...>::output_tuple streaming_node< tuple< Ports... >, JP, StreamFactory >::output_tuple
private

Definition at line 312 of file _flow_graph_streaming_node.h.

Constructor & Destructor Documentation

◆ streaming_node() [1/3]

template<typename... Ports, typename JP , typename StreamFactory >
template<typename DeviceSelector >
streaming_node< tuple< Ports... >, JP, StreamFactory >::streaming_node ( graph &  g,
const kernel_type kernel,
DeviceSelector  d,
StreamFactory &  f 
)
inline

Definition at line 674 of file _flow_graph_streaming_node.h.

675  : base_type( g )
676  , my_indexer_node( g )
677  , my_device_selector( new device_selector<DeviceSelector>( d, *this, f ) )
678  , my_device_selector_node( g, serial, device_selector_body( my_device_selector ) )
679  , my_join_node( g )
680  , my_kernel_node( g, serial, kernel_body( *this ) )
681  // By default, streaming_node maps all its ports to the kernel arguments on a one-to-one basis.
682  , my_args_storage( make_args_storage( args_storage<>(kernel, f), port_ref<0, NUM_INPUTS - 1>() ) )
683  {
684  base_type::set_external_ports( get_input_ports(), get_output_ports() );
685  make_edges();
686  }
args_storage_base * make_args_storage(const args_storage_base &storage, Args &&... args) const
composite_node< input_tuple, output_tuple > base_type
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d

◆ streaming_node() [2/3]

template<typename... Ports, typename JP , typename StreamFactory >
streaming_node< tuple< Ports... >, JP, StreamFactory >::streaming_node ( const streaming_node< tuple< Ports... >, JP, StreamFactory > &  node)
inline

Definition at line 688 of file _flow_graph_streaming_node.h.

689  : base_type( node.my_graph )
690  , my_indexer_node( node.my_indexer_node )
691  , my_device_selector( node.my_device_selector->clone( *this ) )
692  , my_device_selector_node( node.my_graph, serial, device_selector_body( my_device_selector ) )
693  , my_join_node( node.my_join_node )
694  , my_kernel_node( node.my_graph, serial, kernel_body( *this ) )
695  , my_args_storage( node.my_args_storage->clone() )
696  {
697  base_type::set_external_ports( get_input_ports(), get_output_ports() );
698  make_edges();
699  }
composite_node< input_tuple, output_tuple > base_type

◆ streaming_node() [3/3]

template<typename... Ports, typename JP , typename StreamFactory >
streaming_node< tuple< Ports... >, JP, StreamFactory >::streaming_node ( streaming_node< tuple< Ports... >, JP, StreamFactory > &&  node)
inline

Definition at line 701 of file _flow_graph_streaming_node.h.

702  : base_type( node.my_graph )
703  , my_indexer_node( std::move( node.my_indexer_node ) )
704  , my_device_selector( node.my_device_selector->clone(*this) )
705  , my_device_selector_node( node.my_graph, serial, device_selector_body( my_device_selector ) )
706  , my_join_node( std::move( node.my_join_node ) )
707  , my_kernel_node( node.my_graph, serial, kernel_body( *this ) )
708  , my_args_storage( node.my_args_storage )
709  {
710  base_type::set_external_ports( get_input_ports(), get_output_ports() );
711  make_edges();
712  // Set moving node mappers to NULL to prevent double deallocation.
713  node.my_args_storage = NULL;
714  }
composite_node< input_tuple, output_tuple > base_type
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319

◆ ~streaming_node()

template<typename... Ports, typename JP , typename StreamFactory >
streaming_node< tuple< Ports... >, JP, StreamFactory >::~streaming_node ( )
inline

Member Function Documentation

◆ enqueue_kernel()

template<typename... Ports, typename JP , typename StreamFactory >
template<typename ... Args>
void streaming_node< tuple< Ports... >, JP, StreamFactory >::enqueue_kernel ( kernel_input_tuple ip,
StreamFactory &  factory,
device_type  device,
const kernel_type kernel,
Args &...  args 
) const
inlineprivate

Definition at line 668 of file _flow_graph_streaming_node.h.

668  {
669  this->enqueue_kernel_impl( ip, factory, device, kernel, args... );
670  }
void enqueue_kernel_impl(kernel_input_tuple &, StreamFactory &factory, device_type device, const kernel_type &kernel, Args &... args) const

References internal::kernel_executor_helper< StreamFactory, KernelInputTuple, typename >::enqueue_kernel_impl().

Here is the call graph for this function:

◆ get_input_ports() [1/2]

template<typename... Ports, typename JP , typename StreamFactory >
template<int... S>
base_type::input_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_input_ports ( internal::sequence< S... >  )
inlineprivate

Definition at line 333 of file _flow_graph_streaming_node.h.

333  {
334  return std::tie( internal::input_port<S>( my_indexer_node )... );
335  }

◆ get_input_ports() [2/2]

template<typename... Ports, typename JP , typename StreamFactory >
base_type::input_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_input_ports ( )
inlineprivate

Definition at line 342 of file _flow_graph_streaming_node.h.

342  {
343  return get_input_ports( input_sequence() );
344  }
internal::make_sequence< NUM_INPUTS >::type input_sequence

◆ get_output_ports() [1/2]

template<typename... Ports, typename JP , typename StreamFactory >
template<int... S>
base_type::output_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_output_ports ( internal::sequence< S... >  )
inlineprivate

Definition at line 338 of file _flow_graph_streaming_node.h.

338  {
339  return std::tie( internal::output_port<S>( my_kernel_node )... );
340  }

◆ get_output_ports() [2/2]

template<typename... Ports, typename JP , typename StreamFactory >
base_type::output_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_output_ports ( )
inlineprivate

Definition at line 346 of file _flow_graph_streaming_node.h.

346  {
347  return get_output_ports( output_sequence() );
348  }
internal::make_sequence< NUM_OUTPUTS >::type output_sequence

◆ make_args_storage()

template<typename... Ports, typename JP , typename StreamFactory >
template<typename... Args>
args_storage_base* streaming_node< tuple< Ports... >, JP, StreamFactory >::make_args_storage ( const args_storage_base &  storage,
Args &&...  args 
) const
inlineprivate

Definition at line 658 of file _flow_graph_streaming_node.h.

658  {
659  // In this variadic template convert all simple types 'T' into 'async_msg_type<T>'
660  return new args_storage<Args...>(storage, std::forward<Args>(args)...);
661  }

◆ make_edges() [1/2]

template<typename... Ports, typename JP , typename StreamFactory >
template<int... S>
void streaming_node< tuple< Ports... >, JP, StreamFactory >::make_edges ( internal::sequence< S... >  )
inlineprivate

Definition at line 357 of file _flow_graph_streaming_node.h.

357  {
360  internal::ignore_return_values( make_Nth_edge<S + 1>()... );
362  }
void ignore_return_values(Args &&...)
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
Definition: flow_graph.h:3838

References internal::ignore_return_values(), and tbb::flow::interface11::make_edge().

Here is the call graph for this function:

◆ make_edges() [2/2]

template<typename... Ports, typename JP , typename StreamFactory >
void streaming_node< tuple< Ports... >, JP, StreamFactory >::make_edges ( )
inlineprivate

◆ make_Nth_edge()

template<typename... Ports, typename JP , typename StreamFactory >
template<int N>
int streaming_node< tuple< Ports... >, JP, StreamFactory >::make_Nth_edge ( )
inlineprivate

Definition at line 351 of file _flow_graph_streaming_node.h.

351  {
352  make_edge( internal::output_port<N>( my_device_selector_node ), internal::input_port<N>( my_join_node ) );
353  return 0;
354  }
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
Definition: flow_graph.h:3838

References tbb::flow::interface11::make_edge().

Here is the call graph for this function:

◆ notify_new_device()

template<typename... Ports, typename JP , typename StreamFactory >
void streaming_node< tuple< Ports... >, JP, StreamFactory >::notify_new_device ( device_type  d)
inlineprivate

Definition at line 663 of file _flow_graph_streaming_node.h.

663  {
664  my_args_storage->send( d );
665  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d

References d.

◆ reset_node()

template<typename... Ports, typename JP , typename StreamFactory >
void streaming_node< tuple< Ports... >, JP, StreamFactory >::reset_node ( reset_flags  = rf_reset_protocol)
inlineprotected

Definition at line 730 of file _flow_graph_streaming_node.h.

730 { __TBB_ASSERT( false, "Not implemented yet" ); }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT.

◆ set_args()

template<typename... Ports, typename JP , typename StreamFactory >
template<typename... Args>
void streaming_node< tuple< Ports... >, JP, StreamFactory >::set_args ( Args &&...  args)
inline

Definition at line 722 of file _flow_graph_streaming_node.h.

722  {
723  // Copy the base class of args_storage and create new storage for "Args...".
724  args_storage_base * const new_args_storage = make_args_storage( *my_args_storage, typename wrap_to_async<Args>::type(std::forward<Args>(args))...);
725  delete my_args_storage;
726  my_args_storage = new_args_storage;
727  }
args_storage_base * make_args_storage(const args_storage_base &storage, Args &&... args) const

Member Data Documentation

◆ my_args_storage

template<typename... Ports, typename JP , typename StreamFactory >
args_storage_base* streaming_node< tuple< Ports... >, JP, StreamFactory >::my_args_storage
private

Definition at line 739 of file _flow_graph_streaming_node.h.

◆ my_device_selector

template<typename... Ports, typename JP , typename StreamFactory >
device_selector_base* streaming_node< tuple< Ports... >, JP, StreamFactory >::my_device_selector
private

Definition at line 734 of file _flow_graph_streaming_node.h.

◆ my_device_selector_node

template<typename... Ports, typename JP , typename StreamFactory >
device_selector_node streaming_node< tuple< Ports... >, JP, StreamFactory >::my_device_selector_node
private

Definition at line 735 of file _flow_graph_streaming_node.h.

◆ my_indexer_node

template<typename... Ports, typename JP , typename StreamFactory >
indexer_node_type streaming_node< tuple< Ports... >, JP, StreamFactory >::my_indexer_node
private

Definition at line 733 of file _flow_graph_streaming_node.h.

◆ my_join_node

template<typename... Ports, typename JP , typename StreamFactory >
join_node<kernel_input_tuple, JP> streaming_node< tuple< Ports... >, JP, StreamFactory >::my_join_node
private

Definition at line 736 of file _flow_graph_streaming_node.h.

◆ my_kernel_node

template<typename... Ports, typename JP , typename StreamFactory >
kernel_multifunction_node streaming_node< tuple< Ports... >, JP, StreamFactory >::my_kernel_node
private

Definition at line 737 of file _flow_graph_streaming_node.h.

◆ NUM_INPUTS

template<typename... Ports, typename JP , typename StreamFactory >
const size_t streaming_node< tuple< Ports... >, JP, StreamFactory >::NUM_INPUTS = tuple_size<input_tuple>::value
staticprivate

Definition at line 320 of file _flow_graph_streaming_node.h.

◆ NUM_OUTPUTS

template<typename... Ports, typename JP , typename StreamFactory >
const size_t streaming_node< tuple< Ports... >, JP, StreamFactory >::NUM_OUTPUTS = tuple_size<output_tuple>::value
staticprivate

Definition at line 321 of file _flow_graph_streaming_node.h.


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

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.