|
| start_scan (sum_node_type *&return_slot_, start_scan &parent_, sum_node_type *parent_sum_) |
|
| start_scan (sum_node_type *&return_slot_, const Range &range_, final_sum_type &body_, const Partitioner &partitioner_) |
|
virtual | ~task () |
| Destructor.
|
|
virtual task * | execute ()=0 |
| Should be overridden by derived classes.
|
|
internal::allocate_continuation_proxy & | allocate_continuation () |
| Returns proxy for overloaded new that allocates a continuation task of *this.
|
|
internal::allocate_child_proxy & | allocate_child () |
| Returns proxy for overloaded new that allocates a child task of *this.
|
|
void | recycle_as_continuation () |
| Change this to be a continuation of its former self.
|
|
void | recycle_as_safe_continuation () |
| Recommended to use, safe variant of recycle_as_continuation.
|
|
void | recycle_as_child_of (task &new_parent) |
| Change this to be a child of new_parent.
|
|
void | recycle_to_reexecute () |
| Schedule this for reexecution after current execute() returns.
|
|
void | set_ref_count (int count) |
| Set reference count.
|
|
void | increment_ref_count () |
| Atomically increment reference count.
|
|
int | add_ref_count (int count) |
| Atomically adds to reference count and returns its new value.
|
|
int | decrement_ref_count () |
| Atomically decrement reference count and returns its new value.
|
|
void | spawn_and_wait_for_all (task &child) |
| Similar to spawn followed by wait_for_all, but more efficient.
|
|
void __TBB_EXPORTED_METHOD | spawn_and_wait_for_all (task_list &list) |
| Similar to spawn followed by wait_for_all, but more efficient.
|
|
void | wait_for_all () |
| Wait for reference count to become one, and set reference count to zero.
|
|
task * | parent () const |
| task on whose behalf this task is working, or NULL if this is a root.
|
|
void | set_parent (task *p) |
| sets parent task pointer to specified value
|
|
task_group_context * | context () |
| This method is deprecated and will be removed in the future.
|
|
task_group_context * | group () |
| Pointer to the task group descriptor.
|
|
bool | is_stolen_task () const |
| True if task was stolen from the task pool of another thread.
|
|
bool | is_enqueued_task () const |
| True if the task was enqueued.
|
|
state_type | state () const |
| Current execution state.
|
|
int | ref_count () const |
| The internal reference count.
|
|
bool __TBB_EXPORTED_METHOD | is_owned_by_current_thread () const |
| Obsolete, and only retained for the sake of backward compatibility. Always returns true.
|
|
void | set_affinity (affinity_id id) |
| Set affinity for this task.
|
|
affinity_id | affinity () const |
| Current affinity of this task.
|
|
virtual void __TBB_EXPORTED_METHOD | note_affinity (affinity_id id) |
| Invoked by scheduler to notify task that it ran on unexpected thread.
|
|
void __TBB_EXPORTED_METHOD | change_group (task_group_context &ctx) |
| Moves this task from its current group into another one.
|
|
bool | cancel_group_execution () |
| Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
|
|
bool | is_cancelled () const |
| Returns true if the context has received cancellation request.
|
|
__TBB_DEPRECATED void | set_group_priority (priority_t p) |
| Changes priority of the task group this task belongs to.
|
|
__TBB_DEPRECATED priority_t | group_priority () const |
| Retrieves current priority of the task group this task belongs to.
|
|
template<typename Range, typename Body, typename Partitioner = simple_partitioner>
class tbb::internal::start_scan< Range, Body, Partitioner >
Initial task to split the work.
Definition at line 186 of file parallel_scan.h.
template<typename Range , typename Body , typename Partitioner >
Should be overridden by derived classes.
Implements tbb::task.
Definition at line 254 of file parallel_scan.h.
254 {
255 typedef internal::finish_scan<Range,Body> finish_pass1_type;
257
258
259
261 if( treat_as_stolen ) {
262
265 }
266 task* next_task = NULL;
275 } else {
279 else
282
284 b.my_is_right_child = true;
285
286
287
289 c.set_ref_count(2);
290 c.spawn(b);
291 my_sum = &result->my_left_sum;
294 next_task = this;
297 }
298 return next_task;
299 }
void const char const char int ITT_FORMAT __itt_group_sync p
sum_node< Range, Body > sum_node_type
start_scan(sum_node_type *&return_slot_, start_scan &parent_, sum_node_type *parent_sum_)
final_sum< Range, Body > final_sum_type
bool is_stolen_task() const
True if task was stolen from the task pool of another thread.
task * parent() const
task on whose behalf this task is working, or NULL if this is a root.
internal::allocate_continuation_proxy & allocate_continuation()
Returns proxy for overloaded new that allocates a continuation task of *this.
void recycle_as_child_of(task &new_parent)
Change this to be a child of new_parent.
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
task()
Default constructor.
References __TBB_ASSERT, tbb::task::allocate_root(), tbb::internal::start_scan< Range, Body, Partitioner >::my_is_right_child, tbb::internal::sum_node< Range, Body >::my_left, tbb::internal::sum_node< Range, Body >::my_left_sum, tbb::internal::sum_node< Range, Body >::my_right, p, and parent.
template<typename Range , typename Body , typename Partitioner = simple_partitioner>
Definition at line 227 of file parallel_scan.h.
227 {
228 if( !range_.empty() ) {
229 typedef internal::start_scan<Range,Body,Partitioner> start_pass1_type;
230 internal::sum_node<Range,Body>* root = NULL;
233 root,
234 range_,
235 *temp_body,
236 partitioner_ );
237 temp_body->my_body.reverse_join(body_);
239 if( root ) {
240 root->my_body = temp_body;
241 root->my_incoming = NULL;
242 root->my_stuff_last = &body_;
244 } else {
245 body_.assign(temp_body->my_body);
246 temp_body->finish_construction( range_, NULL );
247 temp_body->destroy(*temp_body);
248 }
249 }
250 }
static void spawn_root_and_wait(task &root)
Spawn task allocated by allocate_root, wait for it to complete, and deallocate it.
References tbb::task::allocate_root(), tbb::internal::final_sum< Range, Body >::finish_construction(), tbb::internal::final_sum< Range, Body >::my_body, tbb::internal::sum_node< Range, Body >::my_body, tbb::internal::sum_node< Range, Body >::my_incoming, tbb::internal::sum_node< Range, Body >::my_stuff_last, and tbb::task::spawn_root_and_wait().
Referenced by tbb::parallel_scan(), tbb::parallel_scan(), and tbb::parallel_scan().