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_type > | device_with_key_type
typedef composite_node< input_tuple, output_tuple > | base_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_tuple > | device_selector_node
typedef multifunction_node< kernel_input_tuple, output_tuple > | kernel_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.

: base_type( g )
, my_indexer_node( g )
, my_device_selector( new device_selector<DeviceSelector>( d, *this, f ) )
, my_device_selector_node( g, serial, device_selector_body( my_device_selector ) )
, my_join_node( g )
, my_kernel_node( g, serial, kernel_body( *this ) )
// By default, streaming_node maps all its ports to the kernel arguments on a one-to-one basis.
, my_args_storage( make_args_storage( args_storage<>(kernel, f), port_ref<0, NUM_INPUTS - 1>() ) )
{
base_type::set_external_ports( get_input_ports(), get_output_ports() );
make_edges();
}
d
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
Definition: ittnotify_static.h:109
tbb::flow::serial
@ serial
Definition: flow_graph.h:106
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_args_storage
args_storage_base * my_args_storage
Definition: _flow_graph_streaming_node.h:739
streaming_node< tuple< Ports... >, JP, StreamFactory >::get_output_ports
base_type::output_ports_type get_output_ports()
Definition: _flow_graph_streaming_node.h:346
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_kernel_node
kernel_multifunction_node my_kernel_node
Definition: _flow_graph_streaming_node.h:737
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_join_node
join_node< kernel_input_tuple, JP > my_join_node
Definition: _flow_graph_streaming_node.h:736
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_indexer_node
indexer_node_type my_indexer_node
Definition: _flow_graph_streaming_node.h:733
streaming_node< tuple< Ports... >, JP, StreamFactory >::make_edges
void make_edges()
Definition: _flow_graph_streaming_node.h:364
streaming_node< tuple< Ports... >, JP, StreamFactory >::get_input_ports
base_type::input_ports_type get_input_ports()
Definition: _flow_graph_streaming_node.h:342
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_device_selector_node
device_selector_node my_device_selector_node
Definition: _flow_graph_streaming_node.h:735
streaming_node< tuple< Ports... >, JP, StreamFactory >::my_device_selector
device_selector_base * my_device_selector
Definition: _flow_graph_streaming_node.h:734
streaming_node< tuple< Ports... >, JP, StreamFactory >::base_type
composite_node< input_tuple, output_tuple > base_type
Definition: _flow_graph_streaming_node.h:319
streaming_node< tuple< Ports... >, JP, StreamFactory >::make_args_storage
args_storage_base * make_args_storage(const args_storage_base &storage, Args &&... args) const
Definition: _flow_graph_streaming_node.h:658

## 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.

: base_type( node.my_graph )
, my_indexer_node( node.my_indexer_node )
, my_device_selector( node.my_device_selector->clone( *this ) )
, my_device_selector_node( node.my_graph, serial, device_selector_body( my_device_selector ) )
, my_join_node( node.my_join_node )
, my_kernel_node( node.my_graph, serial, kernel_body( *this ) )
, my_args_storage( node.my_args_storage->clone() )
{
base_type::set_external_ports( get_input_ports(), get_output_ports() );
make_edges();
}

## 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.

: base_type( node.my_graph )
, my_indexer_node( std::move( node.my_indexer_node ) )
, my_device_selector( node.my_device_selector->clone(*this) )
, my_device_selector_node( node.my_graph, serial, device_selector_body( my_device_selector ) )
, my_join_node( std::move( node.my_join_node ) )
, my_kernel_node( node.my_graph, serial, kernel_body( *this ) )
, my_args_storage( node.my_args_storage )
{
base_type::set_external_ports( get_input_ports(), get_output_ports() );
make_edges();
// Set moving node mappers to NULL to prevent double deallocation.
node.my_args_storage = NULL;
}
tbb::move
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

Definition at line 716 of file _flow_graph_streaming_node.h.

{
if ( my_args_storage ) delete my_args_storage;
if ( my_device_selector ) delete my_device_selector;
}

## 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

inline private

Definition at line 668 of file _flow_graph_streaming_node.h.

{
this->enqueue_kernel_impl( ip, factory, device, kernel, args... );
}
internal::kernel_executor_helper< StreamFactory, internal::streaming_node_traits< JP, StreamFactory, Ports... >::kernel_input_tuple >::enqueue_kernel_impl
void enqueue_kernel_impl(kernel_input_tuple &, StreamFactory &factory, device_type device, const kernel_type &kernel, Args &... args) const
Definition: _flow_graph_streaming_node.h:192

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 >

base_type::input_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_input_ports | ( |  | ) |

inline private

Definition at line 342 of file _flow_graph_streaming_node.h.

{
return get_input_ports( input_sequence() );
}
streaming_node< tuple< Ports... >, JP, StreamFactory >::input_sequence
internal::make_sequence< NUM_INPUTS >::type input_sequence
Definition: _flow_graph_streaming_node.h:323

## get_input_ports() [2/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... > |  | ) |

inline private

Definition at line 333 of file _flow_graph_streaming_node.h.

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

## get_output_ports() [1/2]

template<typename... Ports, typename JP , typename StreamFactory >

base_type::output_ports_type streaming_node< tuple< Ports... >, JP, StreamFactory >::get_output_ports | ( |  | ) |

inline private

Definition at line 346 of file _flow_graph_streaming_node.h.

{
return get_output_ports( output_sequence() );
}
streaming_node< tuple< Ports... >, JP, StreamFactory >::output_sequence
internal::make_sequence< NUM_OUTPUTS >::type output_sequence
Definition: _flow_graph_streaming_node.h:324

## get_output_ports() [2/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... > |  | ) |

inline private

Definition at line 338 of file _flow_graph_streaming_node.h.

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

## 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

inline private

Definition at line 658 of file _flow_graph_streaming_node.h.

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

## make_edges() [1/2]

template<typename... Ports, typename JP , typename StreamFactory >

void streaming_node< tuple< Ports... >, JP, StreamFactory >::make_edges | ( |  | ) |

inline private

Definition at line 364 of file _flow_graph_streaming_node.h.

{
make_edges( input_sequence() );
}

## make_edges() [2/2]

template<typename... Ports, typename JP , typename StreamFactory >
template<int... S>

void streaming_node< tuple< Ports... >, JP, StreamFactory >::make_edges | ( | internal::sequence< S... > |  | ) |

inline private

Definition at line 357 of file _flow_graph_streaming_node.h.

{
make_edge( my_indexer_node, my_device_selector_node );
make_edge( my_device_selector_node, my_join_node );
internal::ignore_return_values( make_Nth_edge<S + 1>()... );
make_edge( my_join_node, my_kernel_node );
}
tbb::flow::interface11::make_edge
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
internal::ignore_return_values
void ignore_return_values(Args &&...)
Definition: _flow_graph_streaming_node.h:63

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

Here is the call graph for this function:

## make_Nth_edge()

template<typename... Ports, typename JP , typename StreamFactory >
template<int N>

int streaming_node< tuple< Ports... >, JP, StreamFactory >::make_Nth_edge | ( |  | ) |

inline private

Definition at line 351 of file _flow_graph_streaming_node.h.

{
make_edge( internal::output_port<N>( my_device_selector_node ), internal::input_port<N>( my_join_node ) );
return 0;
}

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 | ) |

inline private

Definition at line 663 of file _flow_graph_streaming_node.h.

{
my_args_storage->send( d );
}
streaming_node< tuple< Ports... >, JP, StreamFactory >::args_storage_base::send
virtual void send(device_type d)=0

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` | ) |

inline protected

Definition at line 730 of file _flow_graph_streaming_node.h.

{ __TBB_ASSERT( false, "Not implemented yet" ); }
__TBB_ASSERT
#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.

{
// Copy the base class of args_storage and create new storage for "Args...".
args_storage_base * const new_args_storage = make_args_storage( *my_args_storage, typename wrap_to_async<Args>::type(std::forward<Args>(args))...);
delete my_args_storage;
my_args_storage = new_args_storage;
}
streaming_node< tuple< Ports... >, JP, StreamFactory >::wrap_to_async::type
T type
Definition: _flow_graph_streaming_node.h:649

## 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

static private

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

static private

Definition at line 321 of file _flow_graph_streaming_node.h.

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

- _flow_graph_streaming_node.h

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.