#include <common.h>
Inheritance diagram for rpa::range_step_base< It >:
Public Member Functions | |
range_step_base (size_t aStep, chunk_t aMinChkSz) | |
size_t | step (void) const |
template<class Rng2> | |
void | calibrate (Rng2 &aSq2) |
void | calc_wdth (thread_tree_core &aThrTree) |
Computes a realistic minimum number of threads. | |
Private Member Functions | |
range_step_base () | |
void | check (void) const |
As usual, called by bugchk(). | |
Private Attributes | |
size_t | _Step |
Classes | |
class | slice |
Created by 'segmenting' an input range, ie, a range made of a pair of iterators. More... |
rpa::range_step_base< It >::range_step_base | ( | ) | [private] |
rpa::range_step_base< It >::range_step_base | ( | size_t | aStep, | |
chunk_t | aMinChkSz | |||
) | [inline] |
The number of steps must be at least one,1, otherwise nothing can work. By the way, '0' is a special value for the number of steps.
Store the biggest of the three values : 1, aStep, MinChunk. We do not use the function std::max because we want to be sure that it is inlined.
void rpa::range_step_base< It >::calc_wdth | ( | thread_tree_core & | aThrTree | ) | [inline] |
Computes a realistic minimum number of threads.
The output range parameter is not necessary for this kind of scheduling. We do not and cannot change the number of threads.
If the given number of elements to process at a time, is smaller than the (probably known at compile-time) minimum number of elements to process in one go to be efficient, then we increase this number. The constructor already did this check.
We cannot really discuss the number of threads given, because we do not know how many elements must be processed.
void rpa::range_step_base< It >::calibrate | ( | Rng2 & | aSq2 | ) | [inline] |
This operation must be done only once and before any 'chop' : Its use is to calibrate the 'step' to the output sizing requirements : Typically obuf_iterator with a fixed-size buffer : These buffers must be filled with a single 'chop'. The algo 'stdmin' is not used for more inlining.
void rpa::range_step_base< It >::check | ( | void | ) | const [inline, private] |
As usual, called by bugchk().
size_t rpa::range_step_base< It >::step | ( | void | ) | const [inline] |
size_t rpa::range_step_base< It >::_Step [private] |
The 'step' depends of the iterator, the elements number to process, the other iterators and all the costs of incrementations, processing, etc.. and therefore has to be adjusted by the calling program.