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

Classes

class  successor_cache
 
class  broadcast_cache
 
class  round_robin_cache
 
class  predecessor_cache
 
class  reservable_predecessor_cache
 
class  async_storage
 
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  untyped_sender
 
class  untyped_receiver
 
class  async_body_base
 
class  async_body
 
struct  graph_task_comparator
 
class  priority_task_selector
 

Typedefs

typedef tbb::concurrent_priority_queue< graph_task *, graph_task_comparatorgraph_task_priority_queue_t
 

Functions

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

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.

486  {
487  g.my_is_active = true;
488 }

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

Referenced by tbb::flow::interface10::graph::reset().

Here is the caller graph for this function:

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

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

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

Referenced by tbb::flow::interface11::source_node< Output >::reset_node().

Here is the caller graph for this function:

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

490  {
491  g.my_is_active = false;
492 }

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

Referenced by tbb::flow::interface10::graph::reset().

Here is the caller graph for this function:

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

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 }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
bool is_graph_active(tbb::flow::interface10::graph &g)
tbb::task & prioritize_task(tbb::flow::interface10::graph &g, tbb::task &arena_task)

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

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 294 of file flow_graph_opencl_node.h.

294  {
295  opencl_device_list opencl_devices;
296 
297  cl_uint num_platforms;
298  enforce_cl_retcode(clGetPlatformIDs(0, NULL, &num_platforms), "clGetPlatformIDs failed");
299 
300  std::vector<cl_platform_id> platforms(num_platforms);
301  enforce_cl_retcode(clGetPlatformIDs(num_platforms, platforms.data(), NULL), "clGetPlatformIDs failed");
302 
303  cl_uint num_devices;
304  std::vector<cl_platform_id>::iterator platforms_it = platforms.begin();
305  cl_uint num_all_devices = 0;
306  while (platforms_it != platforms.end()) {
307  cl_int err = clGetDeviceIDs(*platforms_it, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
308  if (err == CL_DEVICE_NOT_FOUND) {
309  platforms_it = platforms.erase(platforms_it);
310  }
311  else {
312  enforce_cl_retcode(err, "clGetDeviceIDs failed");
313  num_all_devices += num_devices;
314  ++platforms_it;
315  }
316  }
317 
318  std::vector<cl_device_id> devices(num_all_devices);
319  std::vector<cl_device_id>::iterator devices_it = devices.begin();
320  for (auto p = platforms.begin(); p != platforms.end(); ++p) {
321  enforce_cl_retcode(clGetDeviceIDs((*p), CL_DEVICE_TYPE_ALL, (cl_uint)std::distance(devices_it, devices.end()), &*devices_it, &num_devices), "clGetDeviceIDs failed");
322  devices_it += num_devices;
323  }
324 
325  for (auto d = devices.begin(); d != devices.end(); ++d) {
326  opencl_devices.add(opencl_device((*d)));
327  }
328 
329  return opencl_devices;
330 }
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
void enforce_cl_retcode(cl_int err, std::string msg)

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

Here is the call graph for this function:
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

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

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:1013
static const node_priority_t no_priority
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

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

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.

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 }
internal::return_type_or_void< F >::type execute(F &f)
Definition: task_arena.h:423

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(), tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), 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(), tbb::flow::interface10::graph::reset(), internal::function_input_base< Input, Policy, A, ImplType >::spawn_forward_task(), tbb::flow::interface11::internal::untyped_receiver::try_put(), and tbb::flow::interface11::buffer_node< T, Allocator >::try_put_task().

Here is the call graph for this function:
Here is the caller graph for this function:

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.