Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::internal Namespace Reference

Namespaces

 graph_policy_namespace
 

Classes

struct  aligned_pair
 
struct  alignment_of
 
class  apply_body_task_bypass
 A task that calls a node's apply_body_bypass function, passing in an input of type Input. More...
 
class  async_body
 
class  async_body_base
 
struct  async_helpers
 
struct  async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >
 
class  async_storage
 
class  broadcast_cache
 A cache of successors that are broadcast to. More...
 
struct  buffer_element_type
 
struct  clear_element
 
struct  clear_element< 1 >
 
class  continue_input
 Implements methods for an executable node that takes continue_msg as input. More...
 
struct  convert_and_call_impl
 
struct  convert_and_call_impl< A1, Args1... >
 
struct  convert_and_call_impl<>
 
struct  count_element
 
class  decrementer
 
class  decrementer< T, continue_msg, void >
 
class  decrementer< T, DecrementType, typename tbb::internal::enable_if< tbb::internal::is_integral< DecrementType >::value, void >::type >
 
struct  default_constructed
 
struct  do_if
 
struct  do_if< T, false >
 
struct  do_if< T, true >
 
struct  emit_element
 
struct  emit_element< 1 >
 
struct  empty_body
 An empty functor that takes an Input and returns a default constructed Output. More...
 
struct  ERROR_Type_Not_allowed_In_Tagged_Msg_Not_Member_Of_Tuple
 
class  forward_task_bypass
 A task that calls a node's forward_task function. More...
 
struct  forwarding_base
 
class  function_body
 A functor that takes an Input and generates an Output. More...
 
class  function_body_leaf
 the leaf for function_body More...
 
class  function_body_leaf< continue_msg, continue_msg, B >
 the leaf for function_body specialized for Input and output of continue_msg More...
 
class  function_body_leaf< continue_msg, Output, B >
 the leaf for function_body specialized for Input of continue_msg More...
 
class  function_body_leaf< Input, continue_msg, B >
 the leaf for function_body specialized for Output of continue_msg More...
 
class  function_input
 Implements methods for a function node that takes a type Input as input and sends. More...
 
class  function_input_base
 Input and scheduling for a function node that takes a type Input as input. More...
 
class  function_input_queue
 
class  function_output
 Implements methods for both executable and function nodes that puts Output to its successors. More...
 
struct  graph_task_comparator
 
struct  has_policy
 
struct  has_policy< ExpectedPolicy, FirstPolicy, Policies... >
 
struct  has_policy< ExpectedPolicy, Policy< Policies... > >
 
struct  has_policy< ExpectedPolicy, SinglePolicy >
 
class  hash_buffer
 
struct  indexer_helper
 
struct  indexer_helper< TupleTypes, 1 >
 
class  indexer_input_port
 
class  indexer_node_base
 indexer_node_base More...
 
class  indexer_node_FE
 
struct  indexer_types
 
struct  init_output_ports
 
class  initializer_list_wrapper
 
struct  input_types
 
struct  input_types< 1, InputTuple >
 
struct  input_types< 10, InputTuple >
 
struct  input_types< 2, InputTuple >
 
struct  input_types< 3, InputTuple >
 
struct  input_types< 4, InputTuple >
 
struct  input_types< 5, InputTuple >
 
struct  input_types< 6, InputTuple >
 
struct  input_types< 7, InputTuple >
 
struct  input_types< 8, InputTuple >
 
struct  input_types< 9, InputTuple >
 
struct  is_element_of
 
struct  is_element_of< Q, 0, Tuple >
 
struct  is_port_ref
 
struct  is_port_ref_impl
 
struct  is_port_ref_impl< port_ref_impl< N1, N2 > >
 
struct  is_port_ref_impl< port_ref_impl< N1, N2 >(*)() >
 
class  item_buffer
 
struct  join_base
 
struct  join_base< N, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
struct  join_helper
 
struct  join_helper< 1 >
 
class  join_node_base
 join_node_base More...
 
class  join_node_FE
 join_node_FE : implements input port policy More...
 
class  join_node_FE< key_matching< K, KHash >, InputTuple, OutputTuple >
 
class  join_node_FE< queueing, InputTuple, OutputTuple >
 
class  join_node_FE< reserving, InputTuple, OutputTuple >
 
class  kernel_executor_helper
 
class  kernel_executor_helper< StreamFactory, KernelInputTuple, typename tbb::internal::void_t< typename StreamFactory::range_type >::type >
 
struct  key_from_message_body
 
struct  key_from_message_body< K &, T >
 
struct  key_from_policy
 
struct  key_from_policy< key_matching< Key & > >
 
struct  key_from_policy< key_matching< Key > >
 
class  key_matching_port
 
struct  key_to_count_functor
 
struct  KeyTrait
 
struct  make_sequence
 
struct  make_sequence< 0, S... >
 
struct  matching_forwarding_base
 
class  multifunction_body
 function_body that takes an Input and a set of output ports More...
 
class  multifunction_body_leaf
 leaf for multifunction. OutputSet can be a std::tuple or a vector. More...
 
class  multifunction_input
 Implements methods for a function node that takes a type Input as input. More...
 
class  multifunction_output
 
class  node_cache
 A node_cache maintains a std::queue of elements of type T. Each operation is protected by a lock. More...
 
struct  num_arguments
 
struct  num_arguments< port_ref_impl< N1, N2 > >
 
struct  num_arguments< port_ref_impl< N1, N2 >(*)()>
 
struct  pick_max
 
struct  pick_one
 
struct  pick_one< false, T1, T2 >
 
struct  pick_one< true, T1, T2 >
 
struct  pick_tuple_max
 
struct  pick_tuple_max< 0, Tuple, Selector >
 
struct  Policy
 
struct  port_ref_impl
 
class  predecessor_cache
 A cache of predecessors that only supports try_get. More...
 
class  priority_task_selector
 
class  queueing_port
 queueing join_port More...
 
class  reservable_item_buffer
 item_buffer with reservable front-end. NOTE: if reserving, do not More...
 
class  reservable_predecessor_cache
 An cache of predecessors that supports requests and reservations. More...
 
class  reserving_port
 The two-phase join port. More...
 
class  round_robin_cache
 A cache of successors that are put in a round-robin fashion. More...
 
class  sequence
 
struct  size_of
 
class  source_body
 A functor that takes no input and generates a value of type Output. More...
 
class  source_body_leaf
 The leaf for source_body. More...
 
class  source_task_bypass
 A task that calls a node's apply_body_bypass function with no input. More...
 
class  streaming_device_with_key
 
struct  streaming_node_traits
 
class  successor_cache
 An abstract cache of successors. More...
 
class  successor_cache< continue_msg, M >
 An abstract cache of successors, specialized to continue_msg. More...
 
class  tagged_msg
 
struct  tagged_null_type
 
struct  type_plus_align
 type mimicking std::pair but with trailing fill to ensure each element of an array More...
 
struct  type_plus_align< T1, T2, 0 >
 
class  type_to_key_function_body
 
class  type_to_key_function_body< Input, Output & >
 
class  type_to_key_function_body_leaf
 
class  type_to_key_function_body_leaf< Input, Output &, B >
 
class  unfolded_indexer_node
 
class  unfolded_join_node
 unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type More...
 
class  unfolded_join_node< 10, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 2, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 3, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 4, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 5, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 6, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 7, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 8, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  unfolded_join_node< 9, key_matching_port, OutputTuple, key_matching< K, KHash > >
 
class  untyped_receiver
 
class  untyped_sender
 
struct  wrap_key_tuple_elements
 
struct  wrap_key_tuple_elements< N, PT, KeyTraits, tbb::flow::tuple< Args... > >
 
struct  wrap_tuple_elements
 
struct  wrap_tuple_elements< N, PT, tbb::flow::tuple< Args... > >
 
struct  Wrapper
 
struct  Wrapper< T[N]>
 
struct  WrapperBase
 

Typedefs

typedef tbb::internal::uint64_t tag_value
 
typedef tbb::concurrent_priority_queue< graph_task *, graph_task_comparatorgraph_task_priority_queue_t
 

Enumerations

enum  op_stat { WAIT = 0, SUCCEEDED, FAILED }
 

Functions

template<typename V , typename T >
const V & cast_to (T const &t)
 
template<typename V , typename T >
bool is_a (T const &t)
 
template<size_t N, typename MOP >
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::typeoutput_port (MOP &op)
 
void check_task_and_spawn (graph &g, task *t)
 
template<typename CompositeType >
void add_nodes_impl (CompositeType *, bool)
 
template<typename CompositeType , typename NodeType1 , typename... NodeTypes>
void add_nodes_impl (CompositeType *c_node, bool visible, const NodeType1 &n1, const NodeTypes &... n)
 
template<size_t N, typename JNT >
tbb::flow::tuple_element< N, typename JNT::input_ports_type >::typeinput_port (JNT &jn)
 templated function to refer to input ports of the join node More...
 
template<typename IndexerNodeBaseType , typename T , size_t K>
taskdo_try_put (const T &v, void *p)
 
template<typename... Args>
void ignore_return_values (Args &&...)
 
template<typename T >
or_return_values (T &&t)
 
template<typename T , typename... Rest>
or_return_values (T &&t, Rest &&... rest)
 
opencl_device_list find_available_devices ()
 
void activate_graph (tbb::flow::interface10::graph &g)
 
void deactivate_graph (tbb::flow::interface10::graph &g)
 
bool is_graph_active (tbb::flow::interface10::graph &g)
 
tbb::taskprioritize_task (tbb::flow::interface10::graph &g, tbb::task &arena_task)
 
void spawn_in_graph_arena (graph &g, tbb::task &arena_task)
 Spawns a task inside graph arena. More...
 
void enqueue_in_graph_arena (graph &g, tbb::task &arena_task)
 Enqueues a task inside graph arena. More...
 
void add_task_to_graph_reset_list (tbb::flow::interface10::graph &g, tbb::task *tp)
 

Typedef Documentation

◆ graph_task_priority_queue_t

◆ tag_value

typedef tbb::internal::uint64_t tbb::flow::interface11::internal::tag_value

Definition at line 29 of file flow_graph.h.

Enumeration Type Documentation

◆ op_stat

Enumerator
WAIT 
SUCCEEDED 
FAILED 

Definition at line 720 of file flow_graph.h.

727 {

Function Documentation

◆ activate_graph()

void tbb::flow::interface11::internal::activate_graph ( tbb::flow::interface10::graph g)
inline

Definition at line 486 of file _flow_graph_impl.h.

References tbb::flow::interface10::graph::my_is_active.

486  {
487  g.my_is_active = true;
488 }

◆ add_nodes_impl() [1/2]

◆ add_nodes_impl() [2/2]

template<typename CompositeType , typename NodeType1 , typename... NodeTypes>
void tbb::flow::interface11::internal::add_nodes_impl ( CompositeType *  c_node,
bool  visible,
const NodeType1 &  n1,
const NodeTypes &...  n 
)

Definition at line 961 of file flow_graph.h.

962  {
963  spin_mutex::scoped_lock lock(my_mutex);
964  my_successors.remove_successor(r);
965  return true;
966  }
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 * lock

◆ add_task_to_graph_reset_list()

void tbb::flow::interface11::internal::add_task_to_graph_reset_list ( tbb::flow::interface10::graph g,
tbb::task tp 
)
inline

Definition at line 537 of file _flow_graph_impl.h.

References tbb::flow::interface10::graph::my_reset_task_list.

537  {
538  g.my_reset_task_list.push_back(tp);
539 }

◆ cast_to()

template<typename V , typename T >
const V& tbb::flow::interface11::internal::cast_to ( T const &  t)

Definition at line 715 of file flow_graph.h.

Referenced by tbb::flow::interface11::write_once_node< T >::try_put_task().

Here is the caller graph for this function:

◆ check_task_and_spawn()

void tbb::flow::interface11::internal::check_task_and_spawn ( graph g,
task t 
)
inline

Definition at line 723 of file flow_graph.h.

727  {

◆ deactivate_graph()

void tbb::flow::interface11::internal::deactivate_graph ( tbb::flow::interface10::graph g)
inline

Definition at line 490 of file _flow_graph_impl.h.

References tbb::flow::interface10::graph::my_is_active.

490  {
491  g.my_is_active = false;
492 }

◆ do_try_put()

template<typename IndexerNodeBaseType , typename T , size_t K>
task* tbb::flow::interface11::internal::do_try_put ( const T &  v,
void p 
)

Definition at line 34 of file flow_graph.h.

41  : 2196 )

◆ enqueue_in_graph_arena()

void tbb::flow::interface11::internal::enqueue_in_graph_arena ( tbb::flow::interface10::graph g,
tbb::task arena_task 
)
inline

Enqueues a task inside graph arena.

Definition at line 530 of file _flow_graph_impl.h.

References __TBB_ASSERT, tbb::task::enqueue(), tbb::interface7::task_arena::is_active(), is_graph_active(), tbb::flow::interface10::graph::my_task_arena, and prioritize_task().

Referenced by tbb::flow::interface11::async_node< Input, Output, Policy, Allocator >::try_put_impl().

530  {
531  if (is_graph_active(g)) {
532  __TBB_ASSERT( g.my_task_arena && g.my_task_arena->is_active(), "Is graph's arena initialized and active?" );
533  task::enqueue(prioritize_task(g, arena_task), *g.my_task_arena);
534  }
535 }
bool is_graph_active(tbb::flow::interface10::graph &g)
tbb::task & prioritize_task(tbb::flow::interface10::graph &g, tbb::task &arena_task)
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_available_devices()

opencl_device_list tbb::flow::interface11::internal::find_available_devices ( )
inline

Definition at line 283 of file flow_graph_opencl_node.h.

References tbb::flow::interface11::opencl_device_list::add(), d, tbb::flow::interface11::enforce_cl_retcode(), and p.

Referenced by tbb::flow::interface11::opencl_info::available_devices().

283  {
284  opencl_device_list opencl_devices;
285 
286  cl_uint num_platforms;
287  enforce_cl_retcode(clGetPlatformIDs(0, NULL, &num_platforms), "clGetPlatformIDs failed");
288 
289  std::vector<cl_platform_id> platforms(num_platforms);
290  enforce_cl_retcode(clGetPlatformIDs(num_platforms, platforms.data(), NULL), "clGetPlatformIDs failed");
291 
292  cl_uint num_devices;
293  std::vector<cl_platform_id>::iterator platforms_it = platforms.begin();
294  cl_uint num_all_devices = 0;
295  while (platforms_it != platforms.end()) {
296  cl_int err = clGetDeviceIDs(*platforms_it, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
297  if (err == CL_DEVICE_NOT_FOUND) {
298  platforms_it = platforms.erase(platforms_it);
299  }
300  else {
301  enforce_cl_retcode(err, "clGetDeviceIDs failed");
302  num_all_devices += num_devices;
303  ++platforms_it;
304  }
305  }
306 
307  std::vector<cl_device_id> devices(num_all_devices);
308  std::vector<cl_device_id>::iterator devices_it = devices.begin();
309  for (auto p = platforms.begin(); p != platforms.end(); ++p) {
310  enforce_cl_retcode(clGetDeviceIDs((*p), CL_DEVICE_TYPE_ALL, (cl_uint)std::distance(devices_it, devices.end()), &*devices_it, &num_devices), "clGetDeviceIDs failed");
311  devices_it += num_devices;
312  }
313 
314  for (auto d = devices.begin(); d != devices.end(); ++d) {
315  opencl_devices.add(opencl_device((*d)));
316  }
317 
318  return opencl_devices;
319 }
void enforce_cl_retcode(cl_int err, std::string msg)
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 const char const char int ITT_FORMAT __itt_group_sync p
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ignore_return_values()

template<typename... Args>
void tbb::flow::interface11::internal::ignore_return_values ( Args &&  ...)

Definition at line 64 of file flow_graph.h.

69 {

◆ input_port()

template<size_t N, typename JNT >
tbb::flow::tuple_element<N, typename JNT::input_ports_type>::type& tbb::flow::interface11::internal::input_port ( JNT &  jn)

templated function to refer to input ports of the join node

Definition at line 1996 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::reset_node(), and tbb::flow::interface11::write_once_node< T >::try_put_task().

1996  :
1998  __TBB_NOINLINE_SYM explicit buffer_node( graph &g ) : graph_node(g), internal::reservable_item_buffer<T>(),
#define __TBB_NOINLINE_SYM
Definition: flow_graph.h:45
Here is the caller graph for this function:

◆ is_a()

template<typename V , typename T >
bool tbb::flow::interface11::internal::is_a ( T const &  t)

Definition at line 718 of file flow_graph.h.

Referenced by tbb::flow::interface11::write_once_node< T >::try_put_task().

Here is the caller graph for this function:

◆ is_graph_active()

bool tbb::flow::interface11::internal::is_graph_active ( tbb::flow::interface10::graph g)
inline

◆ or_return_values() [1/2]

template<typename T >
T tbb::flow::interface11::internal::or_return_values ( T &&  t)

Definition at line 67 of file flow_graph.h.

69 {

◆ or_return_values() [2/2]

template<typename T , typename... Rest>
T tbb::flow::interface11::internal::or_return_values ( T &&  t,
Rest &&...  rest 
)

Definition at line 69 of file flow_graph.h.

69  {
70  namespace flow {
71  using std::tuple;

◆ output_port()

template<size_t N, typename MOP >
tbb::flow::tuple_element<N, typename MOP::output_ports_type>::type& tbb::flow::interface11::internal::output_port ( MOP &  op)

Definition at line 719 of file flow_graph.h.

Referenced by tbb::flow::interface11::write_once_node< T >::try_put_task().

727  {
Here is the caller graph for this function:

◆ prioritize_task()

tbb::task & tbb::flow::interface11::internal::prioritize_task ( tbb::flow::interface10::graph g,
tbb::task arena_task 
)
inline

Non-preemptive priority pattern. The original task is submitted as a work item to the priority queue, and a new critical task is created to take and execute a work item with the highest known priority. The reference counting responsibility is transferred (via allocate_continuation) to the new task.

Non-preemptive priority pattern. The original task is submitted as a work item to the priority queue, and a new critical task is created to take and execute a work item with the highest known priority. The reference counting responsibility is transferred (via allocate_continuation) to the new task.

Definition at line 499 of file _flow_graph_impl.h.

References tbb::task::allocate_continuation(), tbb::internal::make_critical(), tbb::flow::interface10::graph::my_priority_queue, tbb::flow::internal::no_priority, tbb::flow::interface11::graph_task::priority, and tbb::interface5::concurrent_priority_queue< T, Compare, A >::push().

Referenced by enqueue_in_graph_arena(), and spawn_in_graph_arena().

499  {
500  task* critical_task = &t;
501  // TODO: change flow graph's interfaces to work with graph_task type instead of tbb::task.
502  graph_task* gt = static_cast<graph_task*>(&t);
503  if( gt->priority != no_priority ) {
508  critical_task = new( gt->allocate_continuation() ) priority_task_selector(g.my_priority_queue);
509  tbb::internal::make_critical( *critical_task );
510  g.my_priority_queue.push(gt);
511  }
512  return *critical_task;
513 }
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 make_critical(task &t)
Definition: task.h:1002
void push(const_reference elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
tbb::flow::interface11::internal::graph_task_priority_queue_t my_priority_queue
static const node_priority_t no_priority
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spawn_in_graph_arena()

void tbb::flow::interface11::internal::spawn_in_graph_arena ( tbb::flow::interface10::graph g,
tbb::task arena_task 
)
inline

Spawns a task inside graph arena.

Definition at line 521 of file _flow_graph_impl.h.

References __TBB_ASSERT, tbb::interface7::task_arena::execute(), tbb::interface7::task_arena::is_active(), is_graph_active(), tbb::flow::interface10::graph::my_task_arena, and prioritize_task().

Referenced by internal::function_input< Input, Output, Policy, A >::apply_body_impl_bypass(), internal::check_task_and_spawn(), internal::join_node_FE< reserving, InputTuple, OutputTuple >::decrement_port_count(), internal::join_node_FE< queueing, InputTuple, OutputTuple >::decrement_port_count(), internal::join_node_FE< key_matching< K, KHash >, InputTuple, OutputTuple >::fill_output_buffer(), tbb::flow::interface11::limiter_node< T, DecrementType >::forward_task(), internal::join_node_base< JP, InputTuple, OutputTuple >::handle_operations(), tbb::flow::interface11::limiter_node< T, DecrementType >::register_predecessor(), tbb::flow::interface11::limiter_node< T, DecrementType >::register_successor(), tbb::flow::interface11::overwrite_node< T >::register_successor(), internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::spawn_forward_task(), tbb::flow::interface11::source_node< Output >::spawn_put(), and tbb::flow::interface11::buffer_node< T, A >::try_put_task().

521  {
522  if (is_graph_active(g)) {
523  graph::spawn_functor s_fn(prioritize_task(g, arena_task));
525  g.my_task_arena->execute(s_fn);
526  }
527 }
bool is_graph_active(tbb::flow::interface10::graph &g)
tbb::task & prioritize_task(tbb::flow::interface10::graph &g, tbb::task &arena_task)
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
internal::return_type_or_void< F >::type execute(F &f)
Definition: task_arena.h:346
Here is the call graph for this function:
Here is the caller graph for this function:

Copyright © 2005-2019 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.