Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface9::internal::partition_type_base< Partition > Struct Template Reference

Provides default methods for partition objects and common algorithm blocks. More...

#include <partitioner.h>

Collaboration diagram for tbb::interface9::internal::partition_type_base< Partition >:

Public Types

typedef split split_type
 

Public Member Functions

void set_affinity (task &)
 
void note_affinity (task::affinity_id)
 
bool check_being_stolen (task &)
 
bool check_for_demand (task &)
 
bool is_divisible ()
 
depth_t max_depth ()
 
void align_depth (depth_t)
 
template<typename Range >
split_type get_split ()
 
Partition & self ()
 
template<typename StartType , typename Range >
void work_balance (StartType &start, Range &range)
 
template<typename StartType , typename Range >
void execute (StartType &start, Range &range)
 

Detailed Description

template<typename Partition>
struct tbb::interface9::internal::partition_type_base< Partition >

Provides default methods for partition objects and common algorithm blocks.

Definition at line 221 of file partitioner.h.

Member Typedef Documentation

◆ split_type

template<typename Partition >
typedef split tbb::interface9::internal::partition_type_base< Partition >::split_type

Definition at line 222 of file partitioner.h.

Member Function Documentation

◆ align_depth()

template<typename Partition >
void tbb::interface9::internal::partition_type_base< Partition >::align_depth ( depth_t  )
inline

Definition at line 230 of file partitioner.h.

230 { }

◆ check_being_stolen()

template<typename Partition >
bool tbb::interface9::internal::partition_type_base< Partition >::check_being_stolen ( task )
inline

Definition at line 226 of file partitioner.h.

226 { return false; } // part of old should_execute_range()

◆ check_for_demand()

template<typename Partition >
bool tbb::interface9::internal::partition_type_base< Partition >::check_for_demand ( task )
inline

Definition at line 227 of file partitioner.h.

227 { return false; }

◆ execute()

template<typename Partition >
template<typename StartType , typename Range >
void tbb::interface9::internal::partition_type_base< Partition >::execute ( StartType &  start,
Range &  range 
)
inline

Definition at line 240 of file partitioner.h.

240  {
241  // The algorithm in a few words ([]-denotes calls to decision methods of partitioner):
242  // [If this task is stolen, adjust depth and divisions if necessary, set flag].
243  // If range is divisible {
244  // Spread the work while [initial divisions left];
245  // Create trap task [if necessary];
246  // }
247  // If not divisible or [max depth is reached], execute, else do the range pool part
248  if ( range.is_divisible() ) {
249  if ( self().is_divisible() ) {
250  do { // split until is divisible
251  typename Partition::split_type split_obj = self().template get_split<Range>();
252  start.offer_work( split_obj );
253  } while ( range.is_divisible() && self().is_divisible() );
254  }
255  }
256  self().work_balance(start, range);
257  }
void work_balance(StartType &start, Range &range)
Definition: partitioner.h:235

◆ get_split()

template<typename Partition >
template<typename Range >
split_type tbb::interface9::internal::partition_type_base< Partition >::get_split ( )
inline

Definition at line 231 of file partitioner.h.

231 { return split(); }

◆ is_divisible()

template<typename Partition >
bool tbb::interface9::internal::partition_type_base< Partition >::is_divisible ( )
inline

Definition at line 228 of file partitioner.h.

228 { return true; } // part of old should_execute_range()

◆ max_depth()

template<typename Partition >
depth_t tbb::interface9::internal::partition_type_base< Partition >::max_depth ( )
inline

Definition at line 229 of file partitioner.h.

229 { return 0; }

◆ note_affinity()

template<typename Partition >
void tbb::interface9::internal::partition_type_base< Partition >::note_affinity ( task::affinity_id  )
inline

Definition at line 225 of file partitioner.h.

225 {}

◆ self()

template<typename Partition >
Partition& tbb::interface9::internal::partition_type_base< Partition >::self ( )
inline

Definition at line 232 of file partitioner.h.

232 { return *static_cast<Partition*>(this); } // CRTP helper

◆ set_affinity()

template<typename Partition >
void tbb::interface9::internal::partition_type_base< Partition >::set_affinity ( task )
inline

Definition at line 224 of file partitioner.h.

224 {}

◆ work_balance()

template<typename Partition >
template<typename StartType , typename Range >
void tbb::interface9::internal::partition_type_base< Partition >::work_balance ( StartType &  start,
Range &  range 
)
inline

Definition at line 235 of file partitioner.h.

235  {
236  start.run_body( range ); // simple partitioner goes always here
237  }

The documentation for this struct 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.