21 #ifndef __TBB__flow_graph_indexer_impl_H 22 #define __TBB__flow_graph_indexer_impl_H 24 #ifndef __TBB_flow_graph_H 25 #error Do not #include this internal file directly; use public TBB headers instead. 37 template<
typename IndexerNodeBaseType,
typename T,
size_t K>
39 typename IndexerNodeBaseType::output_type o(K, v);
40 return reinterpret_cast<IndexerNodeBaseType *>(
p)->try_put_task(&o);
43 template<
typename TupleTypes,
int N>
45 template<
typename IndexerNodeBaseType,
typename PortTuple>
47 typedef typename tuple_element<N-1, TupleTypes>
::type T;
48 task *(*indexer_node_put_task)(
const T&,
void *) = do_try_put<IndexerNodeBaseType, T, N-1>;
49 tbb::flow::get<N-1>(my_input).set_up(
p, indexer_node_put_task, g);
50 indexer_helper<TupleTypes,N-1>::template set_indexer_node_pointer<IndexerNodeBaseType,PortTuple>(my_input,
p, g);
52 template<
typename InputTuple>
55 tbb::flow::get<N-1>(my_input).reset_receiver(f);
57 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 58 template<
typename InputTuple>
59 static inline void extract(InputTuple &my_input) {
61 tbb::flow::get<N-1>(my_input).extract_receiver();
66 template<
typename TupleTypes>
68 template<
typename IndexerNodeBaseType,
typename PortTuple>
71 task *(*indexer_node_put_task)(
const T&,
void *) = do_try_put<IndexerNodeBaseType, T, 0>;
72 tbb::flow::get<0>(my_input).set_up(
p, indexer_node_put_task, g);
74 template<
typename InputTuple>
76 tbb::flow::get<0>(my_input).reset_receiver(f);
78 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 79 template<
typename InputTuple>
80 static inline void extract(InputTuple &my_input) {
81 tbb::flow::get<0>(my_input).extract_receiver();
90 typedef task* (* forward_function_ptr)(T
const &,
void* );
92 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 93 spin_mutex my_pred_mutex;
94 typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
95 built_predecessors_type my_built_predecessors;
99 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 109 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 110 typedef typename receiver<T>::predecessor_list_type predecessor_list_type;
111 typedef typename receiver<T>::predecessor_type predecessor_type;
113 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
116 spin_mutex::scoped_lock l(my_pred_mutex);
117 return my_built_predecessors.edge_count();
119 void internal_add_built_predecessor(predecessor_type &
p)
__TBB_override {
120 spin_mutex::scoped_lock l(my_pred_mutex);
121 my_built_predecessors.add_edge(
p);
123 void internal_delete_built_predecessor(predecessor_type &
p)
__TBB_override {
124 spin_mutex::scoped_lock l(my_pred_mutex);
125 my_built_predecessors.delete_edge(
p);
127 void copy_predecessors( predecessor_list_type &v)
__TBB_override {
128 spin_mutex::scoped_lock l(my_pred_mutex);
129 my_built_predecessors.copy_edges(v);
145 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 151 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 152 void extract_receiver() { my_built_predecessors.receiver_extract(*
this); }
156 template<
typename InputTuple,
typename OutputType,
typename StructTypes>
172 template<
typename InputTuple,
typename OutputType,
typename StructTypes>
174 public sender<OutputType> {
176 using graph_node::my_graph;
183 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 184 typedef typename sender<output_type>::built_successors_type built_successors_type;
185 typedef typename sender<output_type>::successor_list_type successor_list_type;
191 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 192 , add_blt_succ, del_blt_succ,
193 blt_succ_cnt, blt_succ_cpy
205 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 207 successor_list_type *succv;
217 typedef internal::aggregating_functor<class_type, indexer_node_base_operation>
handler_type;
225 op_list = op_list->next;
226 switch(current->
type) {
242 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 295 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 300 indexer_node_base_operation op_data(r, add_blt_succ);
305 indexer_node_base_operation op_data(r, del_blt_succ);
310 indexer_node_base_operation op_data(blt_succ_cnt);
312 return op_data.cnt_val;
316 indexer_node_base_operation op_data(blt_succ_cpy);
322 indexer_helper<StructTypes,N>::extract(this->
my_inputs);
340 template<
typename InputTuple>
346 template<
typename InputTuple>
353 template<
typename InputTuple>
361 template<
typename InputTuple>
371 template<
typename InputTuple>
382 template<
typename InputTuple>
394 template<
typename InputTuple>
409 template<
typename InputTuple>
425 template<
typename InputTuple>
441 template<
typename InputTuple>
460 template<
typename OutputTuple>
469 template<
class OutputTuple>
tuple_element< 1, InputTuple >::type second_type
tuple_element< 8, InputTuple >::type nineth_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 0, InputTuple >::type first_type
wrap_tuple_elements< N, indexer_input_port, OutputTuple >::type input_ports_type
output_type const * my_arg
static void reset_inputs(InputTuple &my_input, reset_flags f)
tuple_element< 1, InputTuple >::type second_type
tuple_element< 4, InputTuple >::type fifth_type
void reset_node(reset_flags f) __TBB_override
tuple_element< 3, InputTuple >::type fourth_type
friend class run_and_put_task
tuple_element< 6, InputTuple >::type seventh_type
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< 1, InputTuple >::type second_type
indexer_node_FE< InputTuple, output_type, StructTypes > input_ports_type
tuple_element< 8, InputTuple >::type nineth_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 9, InputTuple >::type tenth_type
tuple_element< 4, InputTuple >::type fifth_type
void set_up(void *p, forward_function_ptr f, graph &g)
internal::aggregating_functor< class_type, indexer_node_base_operation > handler_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 5, InputTuple >::type sixth_type
task * try_put_task(output_type const *v)
A cache of successors that are put in a round-robin fashion.
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type, eighth_type > type
indexer_node_base_operation(op_type t)
tuple_element< 6, InputTuple >::type seventh_type
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 0, InputTuple >::type first_type
graph & graph_reference() __TBB_override
indexer_node_base< InputTuple, output_type, StructTypes > class_type
indexer_node_base(graph &g)
internal::tagged_msg< size_t, first_type > 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 ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
internal::indexer_node_FE< input_ports_type, output_type, OutputTuple > indexer_FE_type
unfolded_indexer_node(graph &g)
tuple_element< 0, InputTuple >::type first_type
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
void register_successor(successor_type &r)
tuple_element< 0, InputTuple >::type first_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 4, InputTuple >::type fifth_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 5, InputTuple >::type sixth_type
aggregator< handler_type, indexer_node_base_operation > my_aggregator
void const char const char int ITT_FORMAT __itt_group_sync p
tuple_element< 2, InputTuple >::type third_type
void handle_operations(indexer_node_base_operation *op_list)
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type > 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
indexer_types< OutputTuple >::indexer_base_type base_type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 0, InputTuple >::type first_type
static void set_indexer_node_pointer(PortTuple &my_input, IndexerNodeBaseType *p, graph &g)
task *(* forward_function_ptr)(T const &, void *)
tuple_element< 1, InputTuple >::type second_type
indexer_node_base_operation(const successor_type &s, op_type t)
tuple_element< 3, InputTuple >::type fourth_type
task * do_try_put(const T &v, void *p)
broadcast_cache< output_type, null_rw_mutex > my_successors
indexer_types< OutputTuple >::input_ports_type input_ports_type
internal::indexer_node_base< input_ports_type, output_type, OutputTuple > indexer_base_type
tuple_element< 1, InputTuple >::type second_type
tuple_element< 3, InputTuple >::type fourth_type
tuple_element< 4, InputTuple >::type fifth_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
indexer_node_base_operation(const output_type *e, op_type t)
void set_owner(owner_type *owner)
input_type & input_ports()
tuple_element< 6, InputTuple >::type seventh_type
task * try_put_task(const T &v) __TBB_override
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
tuple_element< 2, InputTuple >::type third_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
indexer_types< OutputTuple >::output_type output_type
tuple_element< 5, InputTuple >::type sixth_type
tuple_element< 3, InputTuple >::type fourth_type
sender< output_type >::successor_type successor_type
internal::tagged_msg< size_t, first_type, second_type > type
tuple_element< 2, InputTuple >::type third_type
tuple_element< 0, InputTuple >::type first_type
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type > type
void const char const char int ITT_FORMAT __itt_group_sync s
void remove_successor(successor_type &r)
tuple_element< 2, InputTuple >::type third_type
forward_function_ptr my_try_put_task
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type > type
tuple_element< 7, InputTuple >::type eighth_type
tuple_element< 0, InputTuple >::type first_type
A cache of successors that are broadcast to.
tuple_element< 2, InputTuple >::type third_type
tuple_element< 0, InputTuple >::type first_type
tuple_element< 3, InputTuple >::type fourth_type
input_types< N, OutputTuple >::type output_type
tuple_element< 7, InputTuple >::type eighth_type
static void set_indexer_node_pointer(PortTuple &my_input, IndexerNodeBaseType *p, graph &g)
tuple_element< 3, InputTuple >::type fourth_type
internal::tagged_msg< size_t, first_type, second_type, third_type > type
void reset_receiver(reset_flags) __TBB_override
tuple_element< 6, InputTuple >::type seventh_type
tuple_element< 5, InputTuple >::type sixth_type
tuple_element< 7, InputTuple >::type eighth_type
void __TBB_store_with_release(volatile T &location, V value)
indexer_node_base(const indexer_node_base &other)
tuple_element< 3, InputTuple >::type fourth_type
static void reset_inputs(InputTuple &my_input, reset_flags f)
task * try_put_task(const T &t) __TBB_override
tuple_element< 5, InputTuple >::type sixth_type
unfolded_indexer_node(const unfolded_indexer_node &other)
internal::tagged_msg< size_t, first_type, second_type, third_type, fourth_type, fifth_type, sixth_type, seventh_type > type