17 #ifndef __TBB__flow_graph_indexer_impl_H 18 #define __TBB__flow_graph_indexer_impl_H 20 #ifndef __TBB_flow_graph_H 21 #error Do not #include this internal file directly; use public TBB headers instead. 33 template<
typename IndexerNodeBaseType,
typename T,
size_t K>
35 typename IndexerNodeBaseType::output_type o(K, v);
36 return reinterpret_cast<IndexerNodeBaseType *>(
p)->try_put_task(&o);
39 template<
typename TupleTypes,
int N>
41 template<
typename IndexerNodeBaseType,
typename PortTuple>
43 typedef typename tuple_element<N-1, TupleTypes>
::type T;
44 task *(*indexer_node_put_task)(
const T&,
void *) = do_try_put<IndexerNodeBaseType, T, N-1>;
45 tbb::flow::get<N-1>(my_input).set_up(
p, indexer_node_put_task, g);
46 indexer_helper<TupleTypes,N-1>::template set_indexer_node_pointer<IndexerNodeBaseType,PortTuple>(my_input,
p, g);
48 template<
typename InputTuple>
51 tbb::flow::get<N-1>(my_input).reset_receiver(f);
53 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 54 template<
typename InputTuple>
55 static inline void extract(InputTuple &my_input) {
57 tbb::flow::get<N-1>(my_input).extract_receiver();
62 template<
typename TupleTypes>
64 template<
typename IndexerNodeBaseType,
typename PortTuple>
67 task *(*indexer_node_put_task)(
const T&,
void *) = do_try_put<IndexerNodeBaseType, T, 0>;
68 tbb::flow::get<0>(my_input).set_up(
p, indexer_node_put_task, g);
70 template<
typename InputTuple>
72 tbb::flow::get<0>(my_input).reset_receiver(f);
74 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 75 template<
typename InputTuple>
76 static inline void extract(InputTuple &my_input) {
77 tbb::flow::get<0>(my_input).extract_receiver();
86 typedef task* (* forward_function_ptr)(T
const &,
void* );
88 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 89 spin_mutex my_pred_mutex;
90 typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
91 built_predecessors_type my_built_predecessors;
95 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 105 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 106 typedef typename receiver<T>::predecessor_list_type predecessor_list_type;
107 typedef typename receiver<T>::predecessor_type predecessor_type;
109 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
112 spin_mutex::scoped_lock l(my_pred_mutex);
113 return my_built_predecessors.edge_count();
115 void internal_add_built_predecessor(predecessor_type &
p)
__TBB_override {
116 spin_mutex::scoped_lock l(my_pred_mutex);
117 my_built_predecessors.add_edge(
p);
119 void internal_delete_built_predecessor(predecessor_type &
p)
__TBB_override {
120 spin_mutex::scoped_lock l(my_pred_mutex);
121 my_built_predecessors.delete_edge(
p);
123 void copy_predecessors( predecessor_list_type &v)
__TBB_override {
124 spin_mutex::scoped_lock l(my_pred_mutex);
125 my_built_predecessors.copy_edges(v);
141 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 147 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 148 void extract_receiver() { my_built_predecessors.receiver_extract(*
this); }
152 template<
typename InputTuple,
typename OutputType,
typename StructTypes>
168 template<
typename InputTuple,
typename OutputType,
typename StructTypes>
170 public sender<OutputType> {
172 using graph_node::my_graph;
179 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 180 typedef typename sender<output_type>::built_successors_type built_successors_type;
181 typedef typename sender<output_type>::successor_list_type successor_list_type;
187 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 188 , add_blt_succ, del_blt_succ,
189 blt_succ_cnt, blt_succ_cpy
201 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 203 successor_list_type *succv;
221 op_list = op_list->
next;
222 switch(current->
type) {
238 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 291 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 296 indexer_node_base_operation op_data(r, add_blt_succ);
301 indexer_node_base_operation op_data(r, del_blt_succ);
306 indexer_node_base_operation op_data(blt_succ_cnt);
308 return op_data.cnt_val;
312 indexer_node_base_operation op_data(blt_succ_cpy);
318 indexer_helper<StructTypes,N>::extract(this->
my_inputs);
336 template<
typename InputTuple>
342 template<
typename InputTuple>
349 template<
typename InputTuple>
357 template<
typename InputTuple>
367 template<
typename InputTuple>
378 template<
typename InputTuple>
390 template<
typename InputTuple>
405 template<
typename InputTuple>
421 template<
typename InputTuple>
437 template<
typename InputTuple>
456 template<
typename OutputTuple>
465 template<
class OutputTuple>
A cache of successors that are put in a round-robin fashion.
tuple_element< 2, InputTuple >::type third_type
internal::tagged_msg< size_t, first_type, second_type > type
input_type & input_ports()
internal::indexer_node_base< input_ports_type, output_type, OutputTuple > indexer_base_type
tuple_element< 3, InputTuple >::type fourth_type
friend class run_and_put_task
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
tuple_element< 8, InputTuple >::type nineth_type
tuple_element< 8, InputTuple >::type nineth_type
tuple_element< 0, InputTuple >::type first_type
indexer_node_base< InputTuple, output_type, StructTypes > class_type
indexer_node_base_operation(const output_type *e, op_type t)
tuple_element< 5, InputTuple >::type sixth_type
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type > type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 1, InputTuple >::type second_type
void handle_operations(indexer_node_base_operation *op_list)
unfolded_indexer_node(const unfolded_indexer_node &other)
task * do_try_put(const T &v, void *p)
tuple_element< 6, InputTuple >::type seventh_type
uintptr_t status
Zero value means "wait" status, all other values are "user" specified values and are defined into the...
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 5, InputTuple >::type sixth_type
tuple_element< 0, InputTuple >::type first_type
indexer_node_FE< InputTuple, output_type, StructTypes > input_ports_type
tuple_element< 0, InputTuple >::type first_type
internal::tagged_msg< size_t, first_type, second_type, third_type > type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 3, InputTuple >::type fourth_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 9, InputTuple >::type tenth_type
tuple_element< 6, InputTuple >::type seventh_type
void set_up(void *p, forward_function_ptr f, graph &g)
sender< output_type >::successor_type successor_type
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type > type
void reset_node(reset_flags f) __TBB_override
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type, eighth_type, nineth_type, tenth_type > type
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 0, InputTuple >::type first_type
input_types< N, OutputTuple >::type output_type
void __TBB_store_with_release(volatile T &location, V value)
tuple_element< 2, InputTuple >::type third_type
task * try_put_task(const T &t) __TBB_override
tuple_element< 0, InputTuple >::type first_type
tuple_element< 4, InputTuple >::type fifth_type
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type, eighth_type, nineth_type > type
tuple_element< 3, InputTuple >::type fourth_type
static void set_indexer_node_pointer(PortTuple &my_input, IndexerNodeBaseType *p, graph &g)
tuple_element< 6, InputTuple >::type seventh_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 7, InputTuple >::type eighth_type
tuple_element< 4, InputTuple >::type fifth_type
output_type const * my_arg
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 3, InputTuple >::type fourth_type
task * try_put_task(output_type const *v)
tuple_element< 2, InputTuple >::type third_type
void remove_successor(successor_type &r)
void const char const char int ITT_FORMAT __itt_group_sync p
tuple_element< 4, InputTuple >::type fifth_type
wrap_tuple_elements< N, indexer_input_port, OutputTuple >::type input_ports_type
tuple_element< 3, InputTuple >::type fourth_type
A cache of successors that are broadcast to.
static void set_indexer_node_pointer(PortTuple &my_input, IndexerNodeBaseType *p, graph &g)
indexer_node_base(graph &g)
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type > type
static void reset_inputs(InputTuple &my_input, reset_flags f)
aggregator< handler_type, indexer_node_base_operation > my_aggregator
tuple_element< 1, InputTuple >::type second_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 void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
void register_successor(successor_type &r)
indexer_node_base_operation(op_type t)
tuple_element< 1, InputTuple >::type second_type
tuple_element< 2, InputTuple >::type third_type
indexer_types< OutputTuple >::indexer_base_type base_type
aggregated_operation base class
tuple_element< 7, InputTuple >::type eighth_type
task *(* forward_function_ptr)(T const &, void *)
tuple_element< 5, InputTuple >::type sixth_type
static void reset_inputs(InputTuple &my_input, reset_flags f)
forward_function_ptr my_try_put_task
internal::indexer_node_FE< input_ports_type, output_type, OutputTuple > indexer_FE_type
tuple_element< 7, InputTuple >::type eighth_type
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type > type
tuple_element< 3, InputTuple >::type fourth_type
void reset_receiver(reset_flags) __TBB_override
void const char const char int ITT_FORMAT __itt_group_sync s
graph & graph_reference() const __TBB_override
tuple_element< 5, InputTuple >::type sixth_type
indexer_types< OutputTuple >::output_type output_type
indexer_node_base(const indexer_node_base &other)
internal::aggregating_functor< class_type, indexer_node_base_operation > handler_type
tuple_element< 5, InputTuple >::type sixth_type
indexer_types< OutputTuple >::input_ports_type input_ports_type
void set_owner(owner_type *owner)
task * try_put_task(const T &v) __TBB_override
unfolded_indexer_node(graph &g)
tuple_element< 3, InputTuple >::type fourth_type
tuple_element< 0, InputTuple >::type first_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 void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
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 void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
indexer_node_base_operation(const successor_type &s, op_type t)
tuple_element< 0, InputTuple >::type first_type
broadcast_cache< output_type, null_rw_mutex > my_successors
internal::tagged_msg< size_t, first_type > type
tuple_element< 6, InputTuple >::type seventh_type
tuple_element< 1, InputTuple >::type second_type
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type, eighth_type > type