|
dispenso 1.4.1
A library for task parallelism
|
#include <parallel_for.h>
Classes | |
| struct | Auto |
| struct | Static |
Public Types | |
| using | size_type = std::conditional_t<std::is_signed<IntegerT>::value, int64_t, uint64_t> |
Public Member Functions | |
| ChunkedRange (IntegerT s, IntegerT e, IntegerT c) | |
| ChunkedRange (IntegerT s, IntegerT e, Static) | |
| ChunkedRange (IntegerT s, IntegerT e, Auto) | |
| bool | isStatic () const |
| bool | isAuto () const |
| bool | empty () const |
| size_type | size () const |
| template<typename OtherInt > | |
| std::tuple< size_type, size_type > | calcChunkSize (OtherInt numLaunched, bool oneOnCaller, size_type minChunkSize) const |
Public Attributes | |
| IntegerT | start |
| IntegerT | end |
| IntegerT | chunk |
Static Public Attributes | |
| static constexpr IntegerT | kStatic = std::numeric_limits<IntegerT>::max() |
A helper class for parallel_for. It provides various configuration parameters to describe how to break up work for parallel processing. ChunkedRanges can be created with Auto chunking, Static chunking, or specific chunking. Auto chunking makes large chunks for better cache utilization, but tries to make enough chunks to provide some dynamic load balancing. Static chunking makes N chunks given N threads to run the loop on. User-specified chunking can be useful for ensuring e.g. that at least a multiple of SIMD width is provided per chunk. parallel_for calls that don't accept a ChunkedRange will create a ChunkedRange internally using Auto chunking.
Definition at line 88 of file parallel_for.h.
| using dispenso::ChunkedRange< IntegerT >::size_type = std::conditional_t<std::is_signed<IntegerT>::value, int64_t, uint64_t> |
Definition at line 95 of file parallel_for.h.
|
inline |
Create a ChunkedRange with specific chunk size
| s | The start of the range. |
| e | The end of the range. |
| c | The chunk size. |
Definition at line 108 of file parallel_for.h.
|
inline |
Create a ChunkedRange with chunk size equal to total items divided by number of threads.
| s | The start of the range. |
| e | The end of the range. |
Definition at line 115 of file parallel_for.h.
|
inline |
Create a ChunkedRange with chunk size determined automatically to enable some dynamic load balancing.
| s | The start of the range. |
| e | The end of the range. |
Definition at line 123 of file parallel_for.h.
|
inline |
Definition at line 143 of file parallel_for.h.
|
inline |
Definition at line 133 of file parallel_for.h.
|
inline |
Definition at line 129 of file parallel_for.h.
|
inline |
Definition at line 125 of file parallel_for.h.
|
inline |
Definition at line 137 of file parallel_for.h.
| IntegerT dispenso::ChunkedRange< IntegerT >::chunk |
Definition at line 166 of file parallel_for.h.
| IntegerT dispenso::ChunkedRange< IntegerT >::end |
Definition at line 165 of file parallel_for.h.
|
staticconstexpr |
Definition at line 99 of file parallel_for.h.
| IntegerT dispenso::ChunkedRange< IntegerT >::start |
Definition at line 164 of file parallel_for.h.