parallel_do.h
Go to the documentation of this file.
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef __TBB_parallel_do_H
#define __TBB_parallel_do_H
#define __TBB_parallel_do_H_include_area
#include "internal/_warning_suppress_enable_notice.h"
#include "internal/_range_iterator.h"
#include "internal/_template_helpers.h"
#include "task.h"
#include "aligned_space.h"
#include <iterator>
namespace tbb {
namespace interface9 {
namespace internal {
template<typename Body, typename Item> class parallel_do_feeder_impl;
} // namespace internal
template<typename Item>
class parallel_do_feeder: ::tbb::internal::no_copy
{
parallel_do_feeder() {}
virtual ~parallel_do_feeder () {}
virtual void internal_add_copy( const Item& item ) = 0;
#if __TBB_CPP11_RVALUE_REF_PRESENT
virtual void internal_add_move( Item&& item ) = 0;
#endif
template<typename Body_, typename Item_> friend class internal::parallel_do_feeder_impl;
public:
void add( const Item& item ) {internal_add_copy(item);}
#if __TBB_CPP11_RVALUE_REF_PRESENT
void add( Item&& item ) {internal_add_move(std::move(item));}
#endif
};
namespace internal {
template<typename Body> class do_group_task;
template<class Body, typename Item>
class parallel_do_operator_selector
{
typedef parallel_do_feeder<Item> Feeder;
template<typename A1, typename A2, typename CvItem >
static void internal_call( const Body& obj, __TBB_FORWARDING_REF(A1) arg1, A2&, void (Body::*)(CvItem) const ) {
obj(tbb::internal::forward<A1>(arg1));
}
template<typename A1, typename A2, typename CvItem >
static void internal_call( const Body& obj, __TBB_FORWARDING_REF(A1) arg1, A2& arg2, void (Body::*)(CvItem, parallel_do_feeder<Item>&) const ) {
obj(tbb::internal::forward<A1>(arg1), arg2);
}
template<typename A1, typename A2, typename CvItem >
static void internal_call( const Body& obj, __TBB_FORWARDING_REF(A1) arg1, A2&, void (Body::*)(CvItem&) const ) {
obj(arg1);
}
template<typename A1, typename A2, typename CvItem >
static void internal_call( const Body& obj, __TBB_FORWARDING_REF(A1) arg1, A2& arg2, void (Body::*)(CvItem&, parallel_do_feeder<Item>&) const ) {
obj(arg1, arg2);
}
public:
template<typename A1, typename A2>
static void call( const Body& obj, __TBB_FORWARDING_REF(A1) arg1, A2& arg2 )
{
internal_call( obj, tbb::internal::forward<A1>(arg1), arg2, &Body::operator() );
}
};
template<typename Body, typename Item>
class do_iteration_task: public task
{
typedef parallel_do_feeder_impl<Body, Item> feeder_type;
Item my_value;
feeder_type& my_feeder;
do_iteration_task( const Item& value, feeder_type& feeder ) :
my_value(value), my_feeder(feeder)
{}
#if __TBB_CPP11_RVALUE_REF_PRESENT
do_iteration_task( Item&& value, feeder_type& feeder ) :
my_value(std::move(value)), my_feeder(feeder)
{}
#endif
task* execute() __TBB_override
{
parallel_do_operator_selector<Body, Item>::call(*my_feeder.my_body, tbb::internal::move(my_value), my_feeder);
return NULL;
}
template<typename Body_, typename Item_> friend class parallel_do_feeder_impl;
}; // class do_iteration_task
template<typename Iterator, typename Body, typename Item>
class do_iteration_task_iter: public task
{
typedef parallel_do_feeder_impl<Body, Item> feeder_type;
Iterator my_iter;
feeder_type& my_feeder;
do_iteration_task_iter( const Iterator& iter, feeder_type& feeder ) :
my_iter(iter), my_feeder(feeder)
{}
task* execute() __TBB_override
{
parallel_do_operator_selector<Body, Item>::call(*my_feeder.my_body, *my_iter, my_feeder);
return NULL;
}
template<typename Iterator_, typename Body_, typename Item_> friend class do_group_task_forward;
template<typename Body_, typename Item_> friend class do_group_task_input;
template<typename Iterator_, typename Body_, typename Item_> friend class do_task_iter;
}; // class do_iteration_task_iter
template<class Body, typename Item>
class parallel_do_feeder_impl : public parallel_do_feeder<Item>
{
#if __TBB_CPP11_RVALUE_REF_PRESENT
//Avoiding use of copy constructor in a virtual method if the type does not support it
void internal_add_copy_impl(std::true_type, const Item& item) {
typedef do_iteration_task<Body, Item> iteration_type;
iteration_type& t = *new (task::allocate_additional_child_of(*my_barrier)) iteration_type(item, *this);
task::spawn(t);
}
void internal_add_copy_impl(std::false_type, const Item&) {
__TBB_ASSERT(false, "Overloading for r-value reference doesn't work or it's not movable and not copyable object");
}
void internal_add_copy( const Item& item ) __TBB_override
{
#if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
internal_add_copy_impl(typename std::is_copy_constructible<Item>::type(), item);
#else
internal_add_copy_impl(std::true_type(), item);
#endif
}
void internal_add_move( Item&& item ) __TBB_override
{
typedef do_iteration_task<Body, Item> iteration_type;
iteration_type& t = *new (task::allocate_additional_child_of(*my_barrier)) iteration_type(std::move(item), *this);
task::spawn(t);
}
#else /* ! __TBB_CPP11_RVALUE_REF_PRESENT */
void internal_add_copy(const Item& item) __TBB_override {
typedef do_iteration_task<Body, Item> iteration_type;
iteration_type& t = *new (task::allocate_additional_child_of(*my_barrier)) iteration_type(item, *this);
task::spawn(t);
}
#endif /* __TBB_CPP11_RVALUE_REF_PRESENT */
public:
const Body* my_body;
empty_task* my_barrier;
parallel_do_feeder_impl()
{
my_barrier = new( task::allocate_root() ) empty_task();
__TBB_ASSERT(my_barrier, "root task allocation failed");
}
#if __TBB_TASK_GROUP_CONTEXT
parallel_do_feeder_impl(tbb::task_group_context &context)
{
my_barrier = new( task::allocate_root(context) ) empty_task();
__TBB_ASSERT(my_barrier, "root task allocation failed");
}
#endif
~parallel_do_feeder_impl()
{
my_barrier->destroy(*my_barrier);
}
}; // class parallel_do_feeder_impl
template<typename Iterator, typename Body, typename Item>
class do_group_task_forward: public task
{
static const size_t max_arg_size = 4;
typedef parallel_do_feeder_impl<Body, Item> feeder_type;
feeder_type& my_feeder;
Iterator my_first;
size_t my_size;
do_group_task_forward( Iterator first, size_t size, feeder_type& feeder )
: my_feeder(feeder), my_first(first), my_size(size)
{}
task* execute() __TBB_override
{
typedef do_iteration_task_iter<Iterator, Body, Item> iteration_type;
__TBB_ASSERT( my_size>0, NULL );
task_list list;
task* t;
size_t k=0;
for(;;) {
t = new( allocate_child() ) iteration_type( my_first, my_feeder );
++my_first;
if( ++k==my_size ) break;
list.push_back(*t);
}
set_ref_count(int(k+1));
spawn(list);
spawn_and_wait_for_all(*t);
return NULL;
}
template<typename Iterator_, typename Body_, typename _Item> friend class do_task_iter;
}; // class do_group_task_forward
template<typename Body, typename Item>
class do_group_task_input: public task
{
static const size_t max_arg_size = 4;
typedef parallel_do_feeder_impl<Body, Item> feeder_type;
feeder_type& my_feeder;
size_t my_size;
aligned_space<Item, max_arg_size> my_arg;
do_group_task_input( feeder_type& feeder )
: my_feeder(feeder), my_size(0)
{}
task* execute() __TBB_override
{
#if __TBB_CPP11_RVALUE_REF_PRESENT
typedef std::move_iterator<Item*> Item_iterator;
#else
typedef Item* Item_iterator;
#endif
typedef do_iteration_task_iter<Item_iterator, Body, Item> iteration_type;
__TBB_ASSERT( my_size>0, NULL );
task_list list;
task* t;
size_t k=0;
for(;;) {
t = new( allocate_child() ) iteration_type( Item_iterator(my_arg.begin() + k), my_feeder );
if( ++k==my_size ) break;
list.push_back(*t);
}
set_ref_count(int(k+1));
spawn(list);
spawn_and_wait_for_all(*t);
return NULL;
}
~do_group_task_input(){
for( size_t k=0; k<my_size; ++k)
(my_arg.begin() + k)->~Item();
}
template<typename Iterator_, typename Body_, typename Item_> friend class do_task_iter;
}; // class do_group_task_input
template<typename Iterator, typename Body, typename Item>
class do_task_iter: public task
{
typedef parallel_do_feeder_impl<Body, Item> feeder_type;
public:
do_task_iter( Iterator first, Iterator last , feeder_type& feeder ) :
my_first(first), my_last(last), my_feeder(feeder)
{}
private:
Iterator my_first;
Iterator my_last;
feeder_type& my_feeder;
/* Do not merge run(xxx) and run_xxx() methods. They are separated in order
to make sure that compilers will eliminate unused argument of type xxx
(that is will not put it on stack). The sole purpose of this argument
is overload resolution.
An alternative could be using template functions, but explicit specialization
of member function templates is not supported for non specialized class
templates. Besides template functions would always fall back to the least
efficient variant (the one for input iterators) in case of iterators having
custom tags derived from basic ones. */
task* execute() __TBB_override
{
typedef typename std::iterator_traits<Iterator>::iterator_category iterator_tag;
return run( (iterator_tag*)NULL );
}
inline task* run( void* ) { return run_for_input_iterator(); }
task* run_for_input_iterator() {
typedef do_group_task_input<Body, Item> block_type;
block_type& t = *new( allocate_additional_child_of(*my_feeder.my_barrier) ) block_type(my_feeder);
size_t k=0;
while( !(my_first == my_last) ) {
// Move semantics are automatically used when supported by the iterator
new (t.my_arg.begin() + k) Item(*my_first);
++my_first;
if( ++k==block_type::max_arg_size ) {
if ( !(my_first == my_last) )
recycle_to_reexecute();
break;
}
}
if( k==0 ) {
destroy(t);
return NULL;
} else {
t.my_size = k;
return &t;
}
}
inline task* run( std::forward_iterator_tag* ) { return run_for_forward_iterator(); }
task* run_for_forward_iterator() {
typedef do_group_task_forward<Iterator, Body, Item> block_type;
Iterator first = my_first;
size_t k=0;
while( !(my_first==my_last) ) {
++my_first;
if( ++k==block_type::max_arg_size ) {
if ( !(my_first==my_last) )
recycle_to_reexecute();
break;
}
}
return k==0 ? NULL : new( allocate_additional_child_of(*my_feeder.my_barrier) ) block_type(first, k, my_feeder);
}
inline task* run( std::random_access_iterator_tag* ) { return run_for_random_access_iterator(); }
task* run_for_random_access_iterator() {
typedef do_group_task_forward<Iterator, Body, Item> block_type;
typedef do_iteration_task_iter<Iterator, Body, Item> iteration_type;
size_t k = static_cast<size_t>(my_last-my_first);
if( k > block_type::max_arg_size ) {
Iterator middle = my_first + k/2;
empty_task& c = *new( allocate_continuation() ) empty_task;
do_task_iter& b = *new( c.allocate_child() ) do_task_iter(middle, my_last, my_feeder);
recycle_as_child_of(c);
my_last = middle;
c.set_ref_count(2);
c.spawn(b);
return this;
}else if( k != 0 ) {
task_list list;
task* t;
size_t k1=0;
for(;;) {
t = new( allocate_child() ) iteration_type(my_first, my_feeder);
++my_first;
if( ++k1==k ) break;
list.push_back(*t);
}
set_ref_count(int(k+1));
spawn(list);
spawn_and_wait_for_all(*t);
}
return NULL;
}
}; // class do_task_iter
template<typename Iterator, typename Body, typename Item>
void run_parallel_do( Iterator first, Iterator last, const Body& body
#if __TBB_TASK_GROUP_CONTEXT
, task_group_context& context
#endif
)
{
typedef do_task_iter<Iterator, Body, Item> root_iteration_task;
#if __TBB_TASK_GROUP_CONTEXT
parallel_do_feeder_impl<Body, Item> feeder(context);
#else
parallel_do_feeder_impl<Body, Item> feeder;
#endif
feeder.my_body = &body;
root_iteration_task &t = *new( feeder.my_barrier->allocate_child() ) root_iteration_task(first, last, feeder);
feeder.my_barrier->set_ref_count(2);
feeder.my_barrier->spawn_and_wait_for_all(t);
}
template<typename Iterator, typename Body, typename Item>
void select_parallel_do( Iterator first, Iterator last, const Body& body, void (Body::*)(Item) const
#if __TBB_TASK_GROUP_CONTEXT
, task_group_context& context
#endif
)
{
run_parallel_do<Iterator, Body, typename ::tbb::internal::strip<Item>::type>( first, last, body
#if __TBB_TASK_GROUP_CONTEXT
, context
#endif
);
}
template<typename Iterator, typename Body, typename Item, typename _Item>
void select_parallel_do( Iterator first, Iterator last, const Body& body, void (Body::*)(Item, parallel_do_feeder<_Item>&) const
#if __TBB_TASK_GROUP_CONTEXT
, task_group_context& context
#endif
)
{
run_parallel_do<Iterator, Body, typename ::tbb::internal::strip<Item>::type>( first, last, body
#if __TBB_TASK_GROUP_CONTEXT
, context
#endif
);
}
} // namespace internal
} // namespace interface9
template<typename Iterator, typename Body>
void parallel_do( Iterator first, Iterator last, const Body& body )
{
if ( first == last )
return;
#if __TBB_TASK_GROUP_CONTEXT
task_group_context context(internal::PARALLEL_DO);
#endif
interface9::internal::select_parallel_do( first, last, body, &Body::operator()
#if __TBB_TASK_GROUP_CONTEXT
, context
#endif
);
}
template<typename Range, typename Body>
void parallel_do(Range& rng, const Body& body) {
parallel_do(tbb::internal::first(rng), tbb::internal::last(rng), body);
}
template<typename Range, typename Body>
void parallel_do(const Range& rng, const Body& body) {
parallel_do(tbb::internal::first(rng), tbb::internal::last(rng), body);
}
#if __TBB_TASK_GROUP_CONTEXT
template<typename Iterator, typename Body>
void parallel_do( Iterator first, Iterator last, const Body& body, task_group_context& context )
{
if ( first == last )
return;
interface9::internal::select_parallel_do( first, last, body, &Body::operator(), context );
}
template<typename Range, typename Body>
void parallel_do(Range& rng, const Body& body, task_group_context& context) {
parallel_do(tbb::internal::first(rng), tbb::internal::last(rng), body, context);
}
template<typename Range, typename Body>
void parallel_do(const Range& rng, const Body& body, task_group_context& context) {
parallel_do(tbb::internal::first(rng), tbb::internal::last(rng), body, context);
}
#endif // __TBB_TASK_GROUP_CONTEXT
using interface9::parallel_do_feeder;
} // namespace
#include "internal/_warning_suppress_disable_notice.h"
#undef __TBB_parallel_do_H_include_area
#endif /* __TBB_parallel_do_H */
tbb::interface9::internal::parallel_do_operator_selector::internal_call
static void internal_call(const Body &obj, __TBB_FORWARDING_REF(A1) arg1, A2 &arg2, void(Body::*)(CvItem, parallel_do_feeder< Item > &) const)
Definition: parallel_do.h:73
tbb::interface9::internal::do_iteration_task_iter::my_feeder
feeder_type & my_feeder
Definition: parallel_do.h:128
tbb::interface9::internal::do_task_iter::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: parallel_do.h:322
tbb::interface9::internal::do_group_task_input::my_arg
aligned_space< Item, max_arg_size > my_arg
Definition: parallel_do.h:257
tbb::interface9::parallel_do_feeder::add
void add(Item &&item)
Definition: parallel_do.h:53
tbb::interface9::parallel_do_feeder
Class the user supplied algorithm body uses to add new tasks.
Definition: parallel_do.h:40
tbb::task::set_ref_count
void set_ref_count(int count)
Set reference count.
Definition: task.h:750
internal
Definition: _flow_graph_async_msg_impl.h:24
tbb::interface9::internal::do_task_iter::feeder_type
parallel_do_feeder_impl< Body, Item > feeder_type
Definition: parallel_do.h:300
tbb::interface9::internal::parallel_do_operator_selector::internal_call
static void internal_call(const Body &obj, __TBB_FORWARDING_REF(A1) arg1, A2 &, void(Body::*)(CvItem &) const)
Definition: parallel_do.h:77
tbb::interface9::internal::do_task_iter::run
task * run(std::forward_iterator_tag *)
Definition: parallel_do.h:356
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
__TBB_FORWARDING_REF
#define __TBB_FORWARDING_REF(A)
Definition: tbb_stddef.h:517
tbb::internal::no_copy
Base class for types that should not be copied or assigned.
Definition: tbb_stddef.h:330
tbb::interface9::internal::parallel_do_feeder_impl::internal_add_copy_impl
void internal_add_copy_impl(std::false_type, const Item &)
Definition: parallel_do.h:158
tbb::interface9::internal::do_group_task_forward::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: parallel_do.h:226
tbb::interface9::parallel_do_feeder::add
void add(const Item &item)
Add a work item to a running parallel_do.
Definition: parallel_do.h:51
tbb::task_list
A list of children.
Definition: task.h:1063
tbb::interface9::internal::do_iteration_task::my_feeder
feeder_type & my_feeder
Definition: parallel_do.h:101
tbb::interface9::internal::do_group_task_forward::my_size
size_t my_size
Definition: parallel_do.h:220
tbb::interface9::internal::do_group_task_forward::max_arg_size
static const size_t max_arg_size
Definition: parallel_do.h:214
tbb::task_list::push_back
void push_back(task &task)
Push task onto back of list.
Definition: task.h:1080
tbb::interface9::internal::parallel_do_feeder_impl::internal_add_copy_impl
void internal_add_copy_impl(std::true_type, const Item &item)
Definition: parallel_do.h:153
__TBB_TASK_GROUP_CONTEXT
#define __TBB_TASK_GROUP_CONTEXT
Definition: tbb_config.h:542
tbb::task::allocate_child
internal::allocate_child_proxy & allocate_child()
Returns proxy for overloaded new that allocates a child task of *this.
Definition: task.h:670
_range_iterator.h
tbb::interface9::internal::do_iteration_task_iter::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: parallel_do.h:134
tbb::interface9::internal::run_parallel_do
void run_parallel_do(Iterator first, Iterator last, const Body &body, task_group_context &context)
For internal use only.
Definition: parallel_do.h:414
tbb::interface9::internal::parallel_do_operator_selector::Feeder
parallel_do_feeder< Item > Feeder
Definition: parallel_do.h:67
tbb
The graph class.
Definition: serial/tbb/parallel_for.h:46
tbb::interface9::internal::do_group_task_forward::my_feeder
feeder_type & my_feeder
Definition: parallel_do.h:218
tbb::interface9::internal::do_task_iter::my_last
Iterator my_last
Definition: parallel_do.h:309
tbb::interface9::internal::do_iteration_task::do_iteration_task
do_iteration_task(const Item &value, feeder_type &feeder)
Definition: parallel_do.h:103
tbb::empty_task
task that does nothing. Useful for synchronization.
Definition: task.h:1031
tbb::interface9::internal::do_group_task_input::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: parallel_do.h:263
tbb::interface9::internal::do_task_iter
For internal use only.
Definition: parallel_do.h:298
tbb::task_group_context
Used to form groups of tasks.
Definition: task.h:347
tbb::interface9::internal::do_iteration_task_iter
Definition: parallel_do.h:123
tbb::task::spawn_and_wait_for_all
void spawn_and_wait_for_all(task &child)
Similar to spawn followed by wait_for_all, but more efficient.
Definition: task.h:789
tbb::interface9::parallel_do_feeder::internal_add_copy
virtual void internal_add_copy(const Item &item)=0
tbb::interface9::internal::parallel_do_feeder_impl::~parallel_do_feeder_impl
~parallel_do_feeder_impl()
Definition: parallel_do.h:200
tbb::interface9::internal::do_group_task_input::feeder_type
parallel_do_feeder_impl< Body, Item > feeder_type
Definition: parallel_do.h:253
tbb::interface9::internal::do_group_task_input::my_size
size_t my_size
Definition: parallel_do.h:256
size
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 size
Definition: ittnotify_static.h:109
tbb::interface9::internal::do_task_iter::run_for_forward_iterator
task * run_for_forward_iterator()
Definition: parallel_do.h:358
tbb::interface9::internal::parallel_do_operator_selector::call
static void call(const Body &obj, __TBB_FORWARDING_REF(A1) arg1, A2 &arg2)
Definition: parallel_do.h:86
tbb::interface9::internal::parallel_do_operator_selector
For internal use only.
Definition: parallel_do.h:65
tbb::interface9::internal::parallel_do_feeder_impl::parallel_do_feeder_impl
parallel_do_feeder_impl()
Definition: parallel_do.h:186
tbb::interface9::internal::do_group_task_input::~do_group_task_input
~do_group_task_input()
Definition: parallel_do.h:286
_template_helpers.h
tbb::interface9::internal::do_task_iter::run_for_input_iterator
task * run_for_input_iterator()
Definition: parallel_do.h:332
tbb::interface9::internal::parallel_do_feeder_impl::internal_add_copy
void internal_add_copy(const Item &item) __TBB_override
Definition: parallel_do.h:161
aligned_space.h
tbb::task::recycle_to_reexecute
void recycle_to_reexecute()
Schedule this for reexecution after current execute() returns.
Definition: task.h:730
tbb::interface9::parallel_do_feeder::parallel_do_feeder
parallel_do_feeder()
Definition: parallel_do.h:42
task.h
tbb::interface9::internal::select_parallel_do
void select_parallel_do(Iterator first, Iterator last, const Body &body, void(Body::*)(Item) const, task_group_context &context)
For internal use only.
Definition: parallel_do.h:438
tbb::interface9::internal::parallel_do_operator_selector::internal_call
static void internal_call(const Body &obj, __TBB_FORWARDING_REF(A1) arg1, A2 &, void(Body::*)(CvItem) const)
Definition: parallel_do.h:69
tbb::interface9::internal::do_iteration_task::execute
task * execute() __TBB_override
Should be overridden by derived classes.
Definition: parallel_do.h:113
tbb::interface9::parallel_do_feeder::internal_add_move
virtual void internal_add_move(Item &&item)=0
tbb::interface9::internal::do_iteration_task_iter::feeder_type
parallel_do_feeder_impl< Body, Item > feeder_type
Definition: parallel_do.h:125
tbb::interface9::internal::do_task_iter::run
task * run(std::random_access_iterator_tag *)
Definition: parallel_do.h:374
tbb::interface9::internal::parallel_do_feeder_impl::my_body
const Body * my_body
Definition: parallel_do.h:183
tbb::interface9::internal::do_group_task_forward::feeder_type
parallel_do_feeder_impl< Body, Item > feeder_type
Definition: parallel_do.h:216
tbb::move
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319
tbb::interface9::internal::do_task_iter::my_feeder
feeder_type & my_feeder
Definition: parallel_do.h:310
tbb::parallel_do
void parallel_do(Iterator first, Iterator last, const Body &body)
Parallel iteration over a range, with optional addition of more work.
Definition: parallel_do.h:497
tbb::interface9::internal::do_group_task_input
Definition: parallel_do.h:249
tbb::interface9::internal::parallel_do_feeder_impl
For internal use only.
Definition: parallel_do.h:33
tbb::task::recycle_as_child_of
void recycle_as_child_of(task &new_parent)
Change this to be a child of new_parent.
Definition: task.h:714
tbb::interface9::internal::do_group_task_input::my_feeder
feeder_type & my_feeder
Definition: parallel_do.h:255
tbb::interface9::internal::do_iteration_task_iter::do_iteration_task_iter
do_iteration_task_iter(const Iterator &iter, feeder_type &feeder)
Definition: parallel_do.h:130
_warning_suppress_disable_notice.h
tbb::interface9::internal::parallel_do_feeder_impl::parallel_do_feeder_impl
parallel_do_feeder_impl(tbb::task_group_context &context)
Definition: parallel_do.h:193
tbb::internal::first
auto first(Container &c) -> decltype(begin(c))
Definition: _range_iterator.h:34
tbb::interface9::internal::do_group_task_forward
For internal use only.
Definition: parallel_do.h:212
__TBB_override
#define __TBB_override
Definition: tbb_stddef.h:240
tbb::interface9::internal::do_iteration_task::do_iteration_task
do_iteration_task(Item &&value, feeder_type &feeder)
Definition: parallel_do.h:108
tbb::interface9::internal::parallel_do_feeder_impl::my_barrier
empty_task * my_barrier
Definition: parallel_do.h:184
tbb::interface9::internal::do_group_task_forward::my_first
Iterator my_first
Definition: parallel_do.h:219
tbb::internal::true_type
bool_constant< true > true_type
Definition: tbb_stddef.h:489
tbb::interface9::internal::do_group_task_forward::do_group_task_forward
do_group_task_forward(Iterator first, size_t size, feeder_type &feeder)
Definition: parallel_do.h:222
tbb::interface9::internal::do_iteration_task_iter::my_iter
Iterator my_iter
Definition: parallel_do.h:127
tbb::interface9::internal::parallel_do_operator_selector::internal_call
static void internal_call(const Body &obj, __TBB_FORWARDING_REF(A1) arg1, A2 &arg2, void(Body::*)(CvItem &, parallel_do_feeder< Item > &) const)
Definition: parallel_do.h:81
tbb::interface9::internal::do_iteration_task
For internal use only.
Definition: parallel_do.h:96
tbb::interface9::parallel_do_feeder::~parallel_do_feeder
virtual ~parallel_do_feeder()
Definition: parallel_do.h:43
tbb::task::allocate_root
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
Definition: task.h:652
tbb::interface9::internal::do_task_iter::run
task * run(void *)
Definition: parallel_do.h:330
value
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 __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
Definition: ittnotify_static.h:192
tbb::task
Base class for user-defined tasks.
Definition: task.h:604
tbb::interface9::internal::do_task_iter::do_task_iter
do_task_iter(Iterator first, Iterator last, feeder_type &feeder)
Definition: parallel_do.h:303
tbb::task::allocate_continuation
internal::allocate_continuation_proxy & allocate_continuation()
Returns proxy for overloaded new that allocates a continuation task of *this.
Definition: task.h:665
tbb::internal::last
auto last(Container &c) -> decltype(begin(c))
Definition: _range_iterator.h:40
_warning_suppress_enable_notice.h
tbb::internal::false_type
bool_constant< false > false_type
Definition: tbb_stddef.h:490
tbb::interface9::internal::do_iteration_task::feeder_type
parallel_do_feeder_impl< Body, Item > feeder_type
Definition: parallel_do.h:98
tbb::interface9::internal::do_group_task
Definition: parallel_do.h:59
tbb::interface9::internal::do_group_task_input::do_group_task_input
do_group_task_input(feeder_type &feeder)
Definition: parallel_do.h:259
tbb::interface9::internal::parallel_do_feeder_impl::internal_add_move
void internal_add_move(Item &&item) __TBB_override
Definition: parallel_do.h:169
type
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 __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
Definition: ittnotify_static.h:198
tbb::interface9::internal::do_task_iter::my_first
Iterator my_first
Definition: parallel_do.h:308
tbb::interface9::internal::do_group_task_input::max_arg_size
static const size_t max_arg_size
Definition: parallel_do.h:251
tbb::interface9::internal::do_task_iter::run_for_random_access_iterator
task * run_for_random_access_iterator()
Definition: parallel_do.h:376
tbb::interface9::internal::do_iteration_task::my_value
Item my_value
Definition: parallel_do.h:100

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.