Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::serial::interface9::start_for< Range, Body, Partitioner > Class Template Reference

#include <parallel_for.h>

Inheritance diagram for tbb::serial::interface9::start_for< Range, Body, Partitioner >:
Collaboration diagram for tbb::serial::interface9::start_for< Range, Body, Partitioner >:

Static Public Member Functions

static void run (const Range &range, const Body &body, Partitioner &partitioner)
 

Private Member Functions

void execute ()
 
 start_for (const Range &range, const Body &body, Partitioner &partitioner)
 Constructor for root task. More...
 
 start_for (start_for &parent_, typename Partitioner::split_type &split_obj)
 Splitting constructor used to generate children. More...
 
- Private Member Functions inherited from tbb::internal::no_copy
 no_copy ()
 Allow default construction. More...
 

Private Attributes

Range my_range
 
const Body my_body
 
Partitioner::task_partition_type my_partition
 

Detailed Description

template<typename Range, typename Body, typename Partitioner>
class tbb::serial::interface9::start_for< Range, Body, Partitioner >

Definition at line 46 of file serial/tbb/parallel_for.h.

Constructor & Destructor Documentation

◆ start_for() [1/2]

template<typename Range , typename Body , typename Partitioner >
tbb::serial::interface9::start_for< Range, Body, Partitioner >::start_for ( const Range &  range,
const Body &  body,
Partitioner &  partitioner 
)
inlineprivate

Constructor for root task.

Definition at line 53 of file serial/tbb/parallel_for.h.

53  :
54  my_range( range ),
55  my_body( body ),
56  my_partition( partitioner )
57  {
58  }
Partitioner::task_partition_type my_partition

◆ start_for() [2/2]

template<typename Range , typename Body , typename Partitioner >
tbb::serial::interface9::start_for< Range, Body, Partitioner >::start_for ( start_for< Range, Body, Partitioner > &  parent_,
typename Partitioner::split_type &  split_obj 
)
inlineprivate

Splitting constructor used to generate children.

this becomes left child. Newly constructed object is right child.

Definition at line 62 of file serial/tbb/parallel_for.h.

62  :
63  my_range( parent_.my_range, split_obj ),
64  my_body( parent_.my_body ),
65  my_partition( parent_.my_partition, split_obj )
66  {
67  }
Partitioner::task_partition_type my_partition

Member Function Documentation

◆ execute()

template<typename Range , typename Body , typename Partitioner >
void tbb::serial::interface9::start_for< Range, Body, Partitioner >::execute ( )
private

Definition at line 83 of file serial/tbb/parallel_for.h.

83  {
84  if( !my_range.is_divisible() || !my_partition.is_divisible() ) {
85  ANNOTATE_TASK_BEGIN( tbb_parallel_for_range );
86  {
87  my_body( my_range );
88  }
89  ANNOTATE_TASK_END( tbb_parallel_for_range );
90  } else {
91  typename Partitioner::split_type split_obj;
92  start_for b( *this, split_obj );
93  this->execute(); // Execute the left interval first to keep the serial order.
94  b.execute(); // Execute the right interval then.
95  }
96 }
Partitioner::task_partition_type my_partition
start_for(const Range &range, const Body &body, Partitioner &partitioner)
Constructor for root task.

References tbb::serial::interface9::start_for< Range, Body, Partitioner >::execute().

Referenced by tbb::serial::interface9::start_for< Range, Body, Partitioner >::execute(), and tbb::serial::interface9::start_for< Range, Body, Partitioner >::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

template<typename Range , typename Body , typename Partitioner >
static void tbb::serial::interface9::start_for< Range, Body, Partitioner >::run ( const Range &  range,
const Body &  body,
Partitioner &  partitioner 
)
inlinestatic

Definition at line 70 of file serial/tbb/parallel_for.h.

70  {
71  if( !range.empty() ) {
72  ANNOTATE_SITE_BEGIN( tbb_parallel_for );
73  {
74  start_for a( range, body, partitioner );
75  a.execute();
76  }
77  ANNOTATE_SITE_END( tbb_parallel_for );
78  }
79  }
start_for(const Range &range, const Body &body, Partitioner &partitioner)
Constructor for root task.

References tbb::serial::interface9::start_for< Range, Body, Partitioner >::execute().

Referenced by tbb::serial::interface9::parallel_for().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ my_body

template<typename Range , typename Body , typename Partitioner >
const Body tbb::serial::interface9::start_for< Range, Body, Partitioner >::my_body
private

Definition at line 48 of file serial/tbb/parallel_for.h.

◆ my_partition

template<typename Range , typename Body , typename Partitioner >
Partitioner::task_partition_type tbb::serial::interface9::start_for< Range, Body, Partitioner >::my_partition
private

Definition at line 49 of file serial/tbb/parallel_for.h.

◆ my_range

template<typename Range , typename Body , typename Partitioner >
Range tbb::serial::interface9::start_for< Range, Body, Partitioner >::my_range
private

Definition at line 47 of file serial/tbb/parallel_for.h.


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

Copyright © 2005-2019 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.