An iteration range over a 1D data set. Splits divide the range in two based unless the minimum size is reached. Splits are determined by a splitter object. Successive splits result in a binary tree where each leaf represents a unit of work.
More...
#include <Range1d.h>
|
using | iter_type = Iter |
|
using | split_result = SplitResult< Range1d, MAX_SPLITS, DIMENSIONALITY > |
|
using | size_type = size_t |
|
|
| Range1d (Range1d const &)=default |
|
GTS_INLINE | Range1d (iter_type xBegin, iter_type xEnd, size_type minSize, size_type splitOnMultiplesOf=1) |
| Constructs a Range1d. More...
|
|
GTS_INLINE iter_type | begin () const |
|
GTS_INLINE iter_type | end () const |
|
GTS_INLINE iter_type & | begin () |
|
GTS_INLINE iter_type & | end () |
|
GTS_INLINE bool | empty () const |
|
GTS_INLINE size_type | size () const |
|
GTS_INLINE size_type | initialSize () const |
|
GTS_INLINE void | resetInitialSize (size_type initSize) |
|
GTS_INLINE size_type | minSize () const |
|
GTS_INLINE size_type | splitOnMultiplesOf () const |
|
GTS_INLINE bool | isDivisible () const |
|
template<typename TSplitter > |
GTS_INLINE void | split (split_result &result, TSplitter const &splitter) |
| Divides the range based on the splitter. More...
|
|
|
static GTS_INLINE iter_type | splitHelper (Range1d &range, EvenSplitter const &) |
|
static GTS_INLINE iter_type | splitHelper (Range1d &range, ProportionalSplitter const &proportions) |
|
static GTS_INLINE uint16_t | adjustDivisor (uint16_t initialSplitDepth, bool isStatic) |
|
static GTS_INLINE uint16_t | splitInitialDepth (uint16_t initialSplitDepth, bool isStatic) |
|
static GTS_INLINE uint16_t | finalSplitDivisor (uint16_t initialSplitDepth, bool isStatic) |
|
|
static constexpr size_t | SPLIT_FACTOR = 2 |
|
static constexpr size_t | MAX_SPLITS = SPLIT_FACTOR - 1 |
|
static constexpr size_t | DIMENSIONALITY = 1 |
|
template<typename Iter>
class gts::Range1d< Iter >
An iteration range over a 1D data set. Splits divide the range in two based unless the minimum size is reached. Splits are determined by a splitter object. Successive splits result in a binary tree where each leaf represents a unit of work.
Derivative of TBB blocked_range. https://github.com/intel/tbb
◆ Range1d()
template<typename Iter >
GTS_INLINE gts::Range1d< Iter >::Range1d |
( |
iter_type |
xBegin, |
|
|
iter_type |
xEnd, |
|
|
size_type |
minSize, |
|
|
size_type |
splitOnMultiplesOf = 1 |
|
) |
| |
|
inline |
Constructs a Range1d.
- Parameters
-
xBegin | An iterator to the beginning of the range. |
xEnd | An iterator to the xEnd of the range. |
minSize | The smallest sub-range the range can be divided into. Must be >= splitOnMultiplesOf. |
splitOnMultiplesOf | Tries to ensure that each sub-range is a multiple of this value. Useful for things like iterating items to be packed into SIMD vectors. |
◆ split()
template<typename Iter >
template<typename TSplitter >
Divides the range based on the splitter.
- Parameters
-
result | The result of the split. |
splitter | Defines the split behavior. |