tbb::flow::interface11::internal Namespace Reference

## Classes

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

## Typedefs

typedef tbb::concurrent_priority_queue< graph_task *, graph_task_comparator > | graph_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::task & | prioritize_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

typedef tbb::concurrent_priority_queue<graph_task*, graph_task_comparator> tbb::flow::interface11::internal::graph_task_priority_queue_t

Definition at line 181 of file _flow_graph_impl.h.

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

{
g.my_is_active = true;
}

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.

{
g.my_reset_task_list.push_back(tp);
}

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.

{
g.my_is_active = false;
}

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.

{
if (is_graph_active(g)) {
__TBB_ASSERT( g.my_task_arena && g.my_task_arena->is_active(), "Is graph's arena initialized and active?" );
task::enqueue(prioritize_task(g, arena_task), *g.my_task_arena);
}
}

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

{
opencl_device_list opencl_devices;
cl_uint num_platforms;
enforce_cl_retcode(clGetPlatformIDs(0, NULL, &num_platforms), "clGetPlatformIDs failed");
std::vector<cl_platform_id> platforms(num_platforms);
enforce_cl_retcode(clGetPlatformIDs(num_platforms, platforms.data(), NULL), "clGetPlatformIDs failed");
cl_uint num_devices;
std::vector<cl_platform_id>::iterator platforms_it = platforms.begin();
cl_uint num_all_devices = 0;
while (platforms_it != platforms.end()) {
cl_int err = clGetDeviceIDs(*platforms_it, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
if (err == CL_DEVICE_NOT_FOUND) {
platforms_it = platforms.erase(platforms_it);
}
else {
enforce_cl_retcode(err, "clGetDeviceIDs failed");
num_all_devices += num_devices;
++platforms_it;
}
}
std::vector<cl_device_id> devices(num_all_devices);
std::vector<cl_device_id>::iterator devices_it = devices.begin();
for (auto p = platforms.begin(); p != platforms.end(); ++p) {
enforce_cl_retcode(clGetDeviceIDs((*p), CL_DEVICE_TYPE_ALL, (cl_uint)std::distance(devices_it, devices.end()), &*devices_it, &num_devices), "clGetDeviceIDs failed");
devices_it += num_devices;
}
for (auto d = devices.begin(); d != devices.end(); ++d) {
opencl_devices.add(opencl_device((*d)));
}
return opencl_devices;
}

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

Definition at line 494 of file _flow_graph_impl.h.

{
return g.my_is_active;
}

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

Referenced by internal::function_input_base< Input, Policy, Allocator, multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator > >::create_body_task(), internal::function_input_base< Input, Policy, Allocator, multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator > >::create_forward_task(), internal::join_node_FE< reserving, InputTuple, OutputTuple >::decrement_port_count(), internal::join_node_FE< queueing, InputTuple, OutputTuple >::decrement_port_count(), enqueue_in_graph_arena(), internal::continue_input< Output, Policy >::execute(), 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::buffer_node< T, A >::handle_operations_impl(), 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::run(), spawn_in_graph_arena(), tbb::flow::interface11::source_node< Output >::spawn_put(), and tbb::flow::interface11::limiter_node< T, DecrementType >::try_put_task().

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.

{
task* critical_task = &t;
// TODO: change flow graph's interfaces to work with graph_task type instead of tbb::task.
graph_task* gt = static_cast<graph_task*>(&t);
if( gt->priority != no_priority ) {
critical_task = new( gt->allocate_continuation() ) priority_task_selector(g.my_priority_queue);
tbb::internal::make_critical( *critical_task );
g.my_priority_queue.push(gt);
}
return *critical_task;
}

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.

{
if (is_graph_active(g)) {
graph::spawn_functor s_fn(prioritize_task(g, arena_task));
__TBB_ASSERT(g.my_task_arena && g.my_task_arena->is_active(), NULL);
g.my_task_arena->execute(s_fn);
}
}

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, Allocator >::apply_body_impl_bypass(), internal::check_task_and_spawn(), tbb::flow::interface11::combine_tasks(), 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, A >::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, Allocator, multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator > >::spawn_forward_task(), tbb::flow::interface11::source_node< Output >::spawn_put(), tbb::flow::interface11::internal::untyped_receiver::try_put(), and tbb::flow::interface11::buffer_node< T, A >::try_put_task().

Here is the call graph for this function:
Here is the caller graph for this function:
tbb::interface7::task_arena::is_active
bool is_active() const
Definition: task_arena.h:374
tbb::flow::interface11::internal::is_graph_active
bool is_graph_active(tbb::flow::interface10::graph &g)
Definition: _flow_graph_impl.h:494
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface10::graph::my_task_arena
tbb::task_arena * my_task_arena
Definition: _flow_graph_impl.h:424
tbb::interface7::task_arena::execute
internal::return_type_or_void< F >::type execute(F &f)
Definition: task_arena.h:423
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::internal::no_priority
static const node_priority_t no_priority
Definition: _flow_graph_impl.h:64
tbb::flow::interface11::enforce_cl_retcode
void enforce_cl_retcode(cl_int err, std::string msg)
Definition: flow_graph_opencl_node.h:57
tbb::flow::interface11::internal::prioritize_task
tbb::task & prioritize_task(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Definition: _flow_graph_impl.h:499
tbb::flow::interface10::graph::my_reset_task_list
task_list_type my_reset_task_list
Definition: _flow_graph_impl.h:416
task
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
Definition: ittnotify_static.h:119
tbb::flow::interface10::graph::my_is_active
bool my_is_active
Definition: _flow_graph_impl.h:415
p
void const char const char int ITT_FORMAT __itt_group_sync p
Definition: ittnotify_static.h:91
tbb::internal::make_critical
void make_critical(task &t)
Definition: task.h:1002
tbb::interface5::concurrent_priority_queue::push
void push(const_reference elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
Definition: concurrent_priority_queue.h:268
tbb::flow::interface10::graph::my_priority_queue
tbb::flow::interface11::internal::graph_task_priority_queue_t my_priority_queue
Definition: _flow_graph_impl.h:427

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.