|
template<typename IntegerA , typename IntegerB > |
ChunkedRange< std::common_type_t< IntegerA, IntegerB > > | dispenso::makeChunkedRange (IntegerA start, IntegerB end, ParForChunking chunking=ParForChunking::kStatic) |
|
template<typename IntegerA , typename IntegerB , typename IntegerC > |
ChunkedRange< std::common_type_t< IntegerA, IntegerB > > | dispenso::makeChunkedRange (IntegerA start, IntegerB end, IntegerC chunkSize) |
|
template<typename TaskSetT , typename IntegerT , typename F , typename StateContainer , typename StateGen > |
void | dispenso::parallel_for (TaskSetT &taskSet, StateContainer &states, const StateGen &defaultState, const ChunkedRange< IntegerT > &range, F &&f, ParForOptions options={}) |
|
template<typename TaskSetT , typename IntegerT , typename F > |
void | dispenso::parallel_for (TaskSetT &taskSet, const ChunkedRange< IntegerT > &range, F &&f, ParForOptions options={}) |
|
template<typename IntegerT , typename F > |
void | dispenso::parallel_for (const ChunkedRange< IntegerT > &range, F &&f, ParForOptions options={}) |
|
template<typename F , typename IntegerT , typename StateContainer , typename StateGen > |
void | dispenso::parallel_for (StateContainer &states, const StateGen &defaultState, const ChunkedRange< IntegerT > &range, F &&f, ParForOptions options={}) |
|
template<typename TaskSetT , typename IntegerA , typename IntegerB , typename F , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true, std::enable_if_t< detail::CanInvoke< F(IntegerA)>::value, bool > = true> |
void | dispenso::parallel_for (TaskSetT &taskSet, IntegerA start, IntegerB end, F &&f, ParForOptions options={}) |
|
template<typename IntegerA , typename IntegerB , typename F , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true> |
void | dispenso::parallel_for (IntegerA start, IntegerB end, F &&f, ParForOptions options={}) |
|
template<typename TaskSetT , typename IntegerA , typename IntegerB , typename F , typename StateContainer , typename StateGen , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true, std::enable_if_t< detail::CanInvoke< F(typename StateContainer::reference, IntegerA)>::value, bool > = true> |
void | dispenso::parallel_for (TaskSetT &taskSet, StateContainer &states, const StateGen &defaultState, IntegerA start, IntegerB end, F &&f, ParForOptions options={}) |
|
template<typename IntegerA , typename IntegerB , typename F , typename StateContainer , typename StateGen , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true> |
void | dispenso::parallel_for (StateContainer &states, const StateGen &defaultState, IntegerA start, IntegerB end, F &&f, ParForOptions options={}) |
|
Functions for performing parallel for loops.
Definition in file parallel_for.h.
Chunking strategy. Typically if the cost of each loop iteration is roughly constant, kStatic load balancing is preferred. Additionally, when making a non-waiting parallel_for call in conjunction with other parallel_for calls or with other task submissions to a TaskSet, some dynamic load balancing is automatically introduced, and selecting kStatic load balancing here can be better. If the workload per iteration deviates a lot from constant, and some ranges may be much cheaper than others, select kAuto.
Definition at line 33 of file parallel_for.h.
template<typename IntegerA , typename IntegerB , typename F , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true>
Execute loop over the range in parallel on the global thread pool and block on loop completion.
- Parameters
-
start | The start of the loop extents. |
end | The end of the loop extents. |
f | The functor to execute in parallel. Must have a signature like void(size_t index) or void(size_t begin, size_t end) . |
options | See ParForOptions for details. options.wait will always be reset to true. |
Definition at line 647 of file parallel_for.h.
template<typename IntegerA , typename IntegerB , typename F , typename StateContainer , typename StateGen , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true>
Execute loop over the range in parallel on the global thread pool and block until loop completion.
- Parameters
-
states | A container of State (actual type of State TBD by user). The container will be resized to hold a State object per executing thread. Container must provide emplace_back() and must be forward-iterable. Examples include std::vector, std::deque, and std::list. These are the states passed into f , and states must remain a valid object until work is completed. |
defaultState | A functor with signature State(). It will be called to initialize the objects for states . |
start | The start of the loop extents. |
end | The end of the loop extents. |
f | The functor to execute in parallel. Must have a signature like void(State &s, size_t index) or void(State &s, size_t begin, size_t end) . |
options | See ParForOptions for details. options.wait will always be reset to true. |
Definition at line 757 of file parallel_for.h.
template<typename TaskSetT , typename IntegerA , typename IntegerB , typename F , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true, std::enable_if_t< detail::CanInvoke< F(IntegerA)>::value, bool > = true>
Execute loop over the range in parallel.
- Parameters
-
taskSet | The task set to schedule the loop on. |
start | The start of the loop extents. |
end | The end of the loop extents. |
f | The functor to execute in parallel. Must have a signature like void(size_t index) or void(size_t begin, size_t end) . |
options | See ParForOptions for details. |
Definition at line 593 of file parallel_for.h.
template<typename TaskSetT , typename IntegerT , typename F , typename StateContainer , typename StateGen >
Execute loop over the range in parallel.
- Parameters
-
taskSet | The task set to schedule the loop on. |
states | A container of State (actual type of State TBD by user). The container will be resized to hold a State object per executing thread. Container must provide emplace_back() and must be forward-iterable. Examples include std::vector, std::deque, and std::list. These are the states passed into f , and states must remain a valid object until work is completed. |
defaultState | A functor with signature State(). It will be called to initialize the objects for states . |
range | The range defining the loop extents as well as chunking strategy. |
f | The functor to execute in parallel. Must have a signature like void(State &s, size_t begin, size_t end) . |
options | See ParForOptions for details. |
Definition at line 344 of file parallel_for.h.
template<typename TaskSetT , typename IntegerA , typename IntegerB , typename F , typename StateContainer , typename StateGen , std::enable_if_t< std::is_integral< IntegerA >::value, bool > = true, std::enable_if_t< std::is_integral< IntegerB >::value, bool > = true, std::enable_if_t< detail::CanInvoke< F(typename StateContainer::reference, IntegerA)>::value, bool > = true>
Execute loop over the range in parallel.
- Parameters
-
taskSet | The task set to schedule the loop on. |
states | A container of State (actual type of State TBD by user). The container will be resized to hold a State object per executing thread. Container must provide emplace_back() and must be forward-iterable. Examples include std::vector, std::deque, and std::list. These are the states passed into f , and states must remain a valid object until work is completed. |
defaultState | A functor with signature State(). It will be called to initialize the objects for states . |
start | The start of the loop extents. |
end | The end of the loop extents. |
f | The functor to execute in parallel. Must have a signature like void(State &s, size_t index) or void(State &s, size_t begin, size_t end) . |
options | See ParForOptions for details. |
Definition at line 683 of file parallel_for.h.