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.

{ }

## 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.

{ 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.

{ 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.

{
// The algorithm in a few words ([]-denotes calls to decision methods of partitioner):
// [If this task is stolen, adjust depth and divisions if necessary, set flag].
// If range is divisible {
// Spread the work while [initial divisions left];
// Create trap task [if necessary];
// }
// If not divisible or [max depth is reached], execute, else do the range pool part
if ( range.is_divisible() ) {
if ( self().is_divisible() ) {
do { // split until is divisible
typename Partition::split_type split_obj = self().template get_split<Range>();
start.offer_work( split_obj );
} while ( range.is_divisible() && self().is_divisible() );
}
}
self().work_balance(start, range);
}

## 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.

{ 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.

{ 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.

{ 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.

{}

## self()

template<typename Partition >

Partition& tbb::interface9::internal::partition_type_base< Partition >::self | ( |  | ) |

inline

Definition at line 232 of file partitioner.h.

{ 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.

{}

## 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.

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

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

- partitioner.h

tbb::interface9::internal::partition_type_base::work_balance
void work_balance(StartType &start, Range &range)
Definition: partitioner.h:235
tbb::interface9::internal::partition_type_base::is_divisible
bool is_divisible()
Definition: partitioner.h:228

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.