tbb::interface9::internal::proportional_mode< Partition > Struct Template Reference

Provides proportional splitting strategy for partition objects. More...

`#include <partitioner.h>`

Inheritance diagram for tbb::interface9::internal::proportional_mode< Partition >:
Collaboration diagram for tbb::interface9::internal::proportional_mode< Partition >:

## Public Types

typedef Partition | my_partition
Public Types inherited from tbb::interface9::internal::adaptive_mode< Partition >
typedef Partition | my_partition

## Public Member Functions

| proportional_mode ()
| proportional_mode (proportional_mode &src, split)
| proportional_mode (proportional_mode &src, const proportional_split &split_obj)
size_t | do_split (proportional_mode &src, const proportional_split &split_obj)
bool | is_divisible ()
template<typename Range >
proportional_split | get_split ()
Public Member Functions inherited from tbb::interface9::internal::adaptive_mode< Partition >
| adaptive_mode ()
| adaptive_mode (adaptive_mode &src, split)
size_t | do_split (adaptive_mode &src, split)
Public Member Functions inherited from tbb::internal::partition_type_base< Partition >
void | set_affinity (task &)
void | note_affinity (task::affinity_id)
task * | continue_after_execute_range ()
bool | decide_whether_to_delay ()
void | spawn_or_delay (bool, task &b)

## Additional Inherited Members

Public Attributes inherited from tbb::interface9::internal::adaptive_mode< Partition >
size_t | my_divisor
Static Public Attributes inherited from tbb::interface9::internal::adaptive_mode< Partition >
static const unsigned | factor = 1

## Detailed Description

### template<typename Partition>
struct tbb::interface9::internal::proportional_mode< Partition >

Provides proportional splitting strategy for partition objects.

Definition at line 302 of file partitioner.h.

## Member Typedef Documentation

## my_partition

template<typename Partition >

typedef Partition tbb::interface9::internal::proportional_mode< Partition >::my_partition

Definition at line 303 of file partitioner.h.

## Constructor & Destructor Documentation

## proportional_mode() [1/3]

template<typename Partition >

tbb::interface9::internal::proportional_mode< Partition >::proportional_mode | ( |  | ) |

inline

Definition at line 306 of file partitioner.h.

: adaptive_mode<Partition>() {}

## proportional_mode() [2/3]

template<typename Partition >

tbb::interface9::internal::proportional_mode< Partition >::proportional_mode | ( | proportional_mode< Partition > & | src,
|  | split |
| ) |  |

inline

Definition at line 307 of file partitioner.h.

: adaptive_mode<Partition>(src, split()) {}

## proportional_mode() [3/3]

template<typename Partition >

tbb::interface9::internal::proportional_mode< Partition >::proportional_mode | ( | proportional_mode< Partition > & | src,
|  | const proportional_split & | split_obj
| ) |  |

inline

Definition at line 308 of file partitioner.h.

{ self().my_divisor = do_split(src, split_obj); }
tbb::interface9::internal::adaptive_mode::my_divisor
size_t my_divisor
Definition: partitioner.h:264
tbb::interface9::internal::proportional_mode::do_split
size_t do_split(proportional_mode &src, const proportional_split &split_obj)
Definition: partitioner.h:309

## Member Function Documentation

## do_split()

template<typename Partition >

size_t tbb::interface9::internal::proportional_mode< Partition >::do_split | ( | proportional_mode< Partition > & | src,
|  | const proportional_split & | split_obj
| ) |  |

inline

Definition at line 309 of file partitioner.h.

{
#if __TBB_ENABLE_RANGE_FEEDBACK
size_t portion = size_t(float(src.my_divisor) * float(split_obj.right())
/ float(split_obj.left() + split_obj.right()) + 0.5f);
#else
size_t portion = split_obj.right() * my_partition::factor;
#endif
portion = (portion + my_partition::factor/2) & (0ul - my_partition::factor);
#if __TBB_ENABLE_RANGE_FEEDBACK
if (!portion)
portion = my_partition::factor;
else if (portion == src.my_divisor)
portion = src.my_divisor - my_partition::factor;
#endif
src.my_divisor -= portion;
return portion;
}

References tbb::proportional_split::left(), tbb::interface9::internal::adaptive_mode< Partition >::my_divisor, and tbb::proportional_split::right().

Here is the call graph for this function:

## get_split()

template<typename Partition >
template<typename Range >

proportional_split tbb::interface9::internal::proportional_mode< Partition >::get_split | ( |  | ) |

inline

Definition at line 331 of file partitioner.h.

{
// Create a proportion for the number of threads expected to handle "this" subrange
return proportion_helper<Range>::get_split( self().my_divisor / my_partition::factor );
}
tbb::interface9::internal::proportion_helper::get_split
static proportional_split get_split(size_t)
Definition: partitioner.h:285

References tbb::interface9::internal::proportion_helper< Range, typename >::get_split().

Here is the call graph for this function:

## is_divisible()

template<typename Partition >

bool tbb::interface9::internal::proportional_mode< Partition >::is_divisible | ( |  | ) |

inline

Definition at line 327 of file partitioner.h.

{ // part of old should_execute_range()
return self().my_divisor > my_partition::factor;
}

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

- partitioner.h

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.