Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::final_sum< Range, Body > Class Template Reference

Performs final scan for a leaf. More...

#include <parallel_scan.h>

Inheritance diagram for tbb::internal::final_sum< Range, Body >:
Collaboration diagram for tbb::internal::final_sum< Range, Body >:

Public Member Functions

 final_sum (Body &body_)
 
 ~final_sum ()
 
void finish_construction (const Range &range_, Body *stuff_last_)
 
- Public Member Functions inherited from tbb::task
virtual ~task ()
 Destructor. More...
 
internal::allocate_continuation_proxyallocate_continuation ()
 Returns proxy for overloaded new that allocates a continuation task of *this. More...
 
internal::allocate_child_proxyallocate_child ()
 Returns proxy for overloaded new that allocates a child task of *this. More...
 
void recycle_as_continuation ()
 Change this to be a continuation of its former self. More...
 
void recycle_as_safe_continuation ()
 Recommended to use, safe variant of recycle_as_continuation. More...
 
void recycle_as_child_of (task &new_parent)
 Change this to be a child of new_parent. More...
 
void recycle_to_reexecute ()
 Schedule this for reexecution after current execute() returns. More...
 
void set_ref_count (int count)
 Set reference count. More...
 
void increment_ref_count ()
 Atomically increment reference count. More...
 
int add_ref_count (int count)
 Atomically adds to reference count and returns its new value. More...
 
int decrement_ref_count ()
 Atomically decrement reference count and returns its new value. More...
 
void spawn_and_wait_for_all (task &child)
 Similar to spawn followed by wait_for_all, but more efficient. More...
 
void __TBB_EXPORTED_METHOD spawn_and_wait_for_all (task_list &list)
 Similar to spawn followed by wait_for_all, but more efficient. More...
 
void wait_for_all ()
 Wait for reference count to become one, and set reference count to zero. More...
 
taskparent () const
 task on whose behalf this task is working, or NULL if this is a root. More...
 
void set_parent (task *p)
 sets parent task pointer to specified value More...
 
task_group_contextcontext ()
 This method is deprecated and will be removed in the future. More...
 
task_group_contextgroup ()
 Pointer to the task group descriptor. More...
 
bool is_stolen_task () const
 True if task was stolen from the task pool of another thread. More...
 
bool is_enqueued_task () const
 True if the task was enqueued. More...
 
state_type state () const
 Current execution state. More...
 
int ref_count () const
 The internal reference count. More...
 
bool __TBB_EXPORTED_METHOD is_owned_by_current_thread () const
 Obsolete, and only retained for the sake of backward compatibility. Always returns true. More...
 
void set_affinity (affinity_id id)
 Set affinity for this task. More...
 
affinity_id affinity () const
 Current affinity of this task. More...
 
virtual void __TBB_EXPORTED_METHOD note_affinity (affinity_id id)
 Invoked by scheduler to notify task that it ran on unexpected thread. More...
 
void __TBB_EXPORTED_METHOD change_group (task_group_context &ctx)
 Moves this task from its current group into another one. More...
 
bool cancel_group_execution ()
 Initiates cancellation of all tasks in this cancellation group and its subordinate groups. More...
 
bool is_cancelled () const
 Returns true if the context has received cancellation request. More...
 
__TBB_DEPRECATED void set_group_priority (priority_t p)
 Changes priority of the task group this task belongs to. More...
 
__TBB_DEPRECATED priority_t group_priority () const
 Retrieves current priority of the task group this task belongs to. More...
 

Public Attributes

Body my_body
 

Private Member Functions

taskexecute () __TBB_override
 Should be overridden by derived classes. More...
 

Private Attributes

aligned_space< Range > my_range
 
Body * my_stuff_last
 Where to put result of last subrange, or NULL if not last subrange. More...
 

Additional Inherited Members

- Public Types inherited from tbb::task
enum  state_type {
  executing, reexecute, ready, allocated,
  freed, recycle
}
 Enumeration of task states that the scheduler considers. More...
 
typedef internal::affinity_id affinity_id
 An id as used for specifying affinity. More...
 
- Static Public Member Functions inherited from tbb::task
static internal::allocate_root_proxy allocate_root ()
 Returns proxy for overloaded new that allocates a root task. More...
 
static internal::allocate_root_with_context_proxy allocate_root (task_group_context &ctx)
 Returns proxy for overloaded new that allocates a root task associated with user supplied context. More...
 
static void spawn_root_and_wait (task &root)
 Spawn task allocated by allocate_root, wait for it to complete, and deallocate it. More...
 
static void spawn_root_and_wait (task_list &root_list)
 Spawn root tasks on list and wait for all of them to finish. More...
 
static void enqueue (task &t)
 Enqueue task for starvation-resistant execution. More...
 
static void enqueue (task &t, priority_t p)
 Enqueue task for starvation-resistant execution on the specified priority level. More...
 
static void enqueue (task &t, task_arena &arena, priority_t p=priority_t(0))
 Enqueue task in task_arena. More...
 
static task &__TBB_EXPORTED_FUNC self ()
 The innermost task being executed or destroyed by the current thread at the moment. More...
 
- Protected Member Functions inherited from tbb::task
 task ()
 Default constructor. More...
 

Detailed Description

template<typename Range, typename Body>
class tbb::internal::final_sum< Range, Body >

Performs final scan for a leaf.

Definition at line 50 of file parallel_scan.h.

Constructor & Destructor Documentation

◆ final_sum()

template<typename Range , typename Body >
tbb::internal::final_sum< Range, Body >::final_sum ( Body &  body_)
inline

Definition at line 58 of file parallel_scan.h.

58  :
59  my_body(body_,split())
60  {
62  }
Body * my_stuff_last
Where to put result of last subrange, or NULL if not last subrange.
Definition: parallel_scan.h:56
void poison_pointer(T *__TBB_atomic &)
Definition: tbb_stddef.h:305

References tbb::internal::final_sum< Range, Body >::my_stuff_last, and tbb::internal::poison_pointer().

Here is the call graph for this function:

◆ ~final_sum()

template<typename Range , typename Body >
tbb::internal::final_sum< Range, Body >::~final_sum ( )
inline

Definition at line 63 of file parallel_scan.h.

63  {
64  my_range.begin()->~Range();
65  }
aligned_space< Range > my_range
Definition: parallel_scan.h:54

References tbb::internal::final_sum< Range, Body >::my_range.

Member Function Documentation

◆ execute()

template<typename Range , typename Body >
task* tbb::internal::final_sum< Range, Body >::execute ( )
inlineprivatevirtual

Should be overridden by derived classes.

Implements tbb::task.

Definition at line 71 of file parallel_scan.h.

71  {
72  my_body( *my_range.begin(), final_scan_tag() );
73  if( my_stuff_last )
74  my_stuff_last->assign(my_body);
75  return NULL;
76  }
Body * my_stuff_last
Where to put result of last subrange, or NULL if not last subrange.
Definition: parallel_scan.h:56
aligned_space< Range > my_range
Definition: parallel_scan.h:54

References tbb::internal::final_sum< Range, Body >::my_body, tbb::internal::final_sum< Range, Body >::my_range, and tbb::internal::final_sum< Range, Body >::my_stuff_last.

◆ finish_construction()

template<typename Range , typename Body >
void tbb::internal::final_sum< Range, Body >::finish_construction ( const Range &  range_,
Body *  stuff_last_ 
)
inline

Definition at line 66 of file parallel_scan.h.

66  {
67  new( my_range.begin() ) Range(range_);
68  my_stuff_last = stuff_last_;
69  }
Body * my_stuff_last
Where to put result of last subrange, or NULL if not last subrange.
Definition: parallel_scan.h:56
aligned_space< Range > my_range
Definition: parallel_scan.h:54

References tbb::internal::final_sum< Range, Body >::my_range, and tbb::internal::final_sum< Range, Body >::my_stuff_last.

Referenced by tbb::internal::sum_node< Range, Body >::create_child(), and tbb::internal::start_scan< Range, Body, Partitioner >::run().

Here is the caller graph for this function:

Member Data Documentation

◆ my_body

◆ my_range

template<typename Range , typename Body >
aligned_space<Range> tbb::internal::final_sum< Range, Body >::my_range
private

◆ my_stuff_last

template<typename Range , typename Body >
Body* tbb::internal::final_sum< Range, Body >::my_stuff_last
private

Where to put result of last subrange, or NULL if not last subrange.

Definition at line 56 of file parallel_scan.h.

Referenced by tbb::internal::final_sum< Range, Body >::execute(), tbb::internal::final_sum< Range, Body >::final_sum(), and tbb::internal::final_sum< Range, Body >::finish_construction().


The documentation for this class was generated from the following file:

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.