![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Inheritance diagram for TreeMaker< use_tbbmalloc >::SubTreeCreationTask:Public Member Functions | |
| tbb::task * | execute () |
| SubTreeCreationTask (TreeNode *&root, long number_of_nodes) | |
Private Types | |
| typedef TreeMaker< use_tbbmalloc > | MyTreeMaker |
Private Attributes | |
| bool | is_continuation |
| TreeNode *& | my_root |
Definition at line 60 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
typedef TreeMaker<use_tbbmalloc> TreeMaker< use_tbbmalloc >::SubTreeCreationTask::MyTreeMaker [private] |
Definition at line 63 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
| TreeMaker< use_tbbmalloc >::SubTreeCreationTask::SubTreeCreationTask | ( | TreeNode *& | root, |
| long | number_of_nodes | ||
| ) | [inline] |
Definition at line 66 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
References Pi.
: my_root(root), is_continuation(false) { my_root = MyTreeMaker::allocate_node(); my_root->node_count = number_of_nodes; my_root->value = Value(Pi*number_of_nodes); }
| tbb::task* TreeMaker< use_tbbmalloc >::SubTreeCreationTask::execute | ( | ) | [inline, virtual] |
Implements tbb::task.
Definition at line 72 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
{
tbb::task* next = NULL;
if( !is_continuation ) {
long subtree_size = my_root->node_count - 1;
if( subtree_size<1000 ) { /* grainsize */
my_root->left = MyTreeMaker::do_in_one_thread(subtree_size/2);
my_root->right = MyTreeMaker::do_in_one_thread(subtree_size - subtree_size/2);
} else {
// Create tasks before spawning any of them.
tbb::task* a = new( allocate_child() ) SubTreeCreationTask(my_root->left,subtree_size/2);
tbb::task* b = new( allocate_child() ) SubTreeCreationTask(my_root->right,subtree_size - subtree_size/2);
recycle_as_continuation();
is_continuation = true;
set_ref_count(2);
spawn(*b);
next = a;
}
}
return next;
}
bool TreeMaker< use_tbbmalloc >::SubTreeCreationTask::is_continuation [private] |
Definition at line 62 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
TreeNode*& TreeMaker< use_tbbmalloc >::SubTreeCreationTask::my_root [private] |
Definition at line 61 of file Third Party Tech/TBB/tbb30_20100406oss_win/tbb30_20100406oss/examples/task/tree_sum/main.cpp.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.