#include <job_api.hpp>
|
constexpr bool | operator() (const std::size_t count) const |
|
|
static Splitter | EvenSplit (const std::size_t total_num_items, std::size_t num_groups_per_thread=1u) |
| Splits work evenly across the threads depending on the number of workers. More...
|
|
static constexpr Splitter | MaxItemsPerTask (const std::size_t max_items) |
|
template<typename T > |
static constexpr Splitter | MaxDataSize (const std::size_t max_data_size) |
|
Definition at line 526 of file job_api.hpp.
◆ EvenSplit()
static Splitter Job::Splitter::EvenSplit |
( |
const std::size_t |
total_num_items, |
|
|
std::size_t |
num_groups_per_thread = 1u |
|
) |
| |
|
inlinestatic |
Splits work evenly across the threads depending on the number of workers.
Ex: total_num_items = 400 num_groups_per_thread = 2 num_threads = 4
Leads to 8 groups of work each with 50 items. If num_groups_per_thread was changed to 1 then you will get 4 groups of work each with 100 items.
- Parameters
-
total_num_items | The total number of items being processed. |
num_groups_per_thread | The number of groups of items to be created per thread. |
- Returns
- A splitter object for
Job::ParallelFor
.
Definition at line 549 of file job_api.hpp.
551 if (num_groups_per_thread < 1u)
553 num_groups_per_thread = 1u;
556 return Splitter{(total_num_items / num_groups_per_thread) /
NumWorkers()};
std::uint16_t NumWorkers() noexcept
Returns the number of workers created by the system. This function can be called by any thread concur...
References Job::NumWorkers().
◆ MaxItemsPerTask()
static constexpr Splitter Job::Splitter::MaxItemsPerTask |
( |
const std::size_t |
max_items | ) |
|
|
inlinestaticconstexpr |
Definition at line 559 of file job_api.hpp.
561 return Splitter{max_items};
◆ MaxDataSize()
template<typename T >
static constexpr Splitter Job::Splitter::MaxDataSize |
( |
const std::size_t |
max_data_size | ) |
|
|
inlinestaticconstexpr |
Definition at line 565 of file job_api.hpp.
567 return Splitter{max_data_size /
sizeof(T)};
◆ operator()()
constexpr bool Job::Splitter::operator() |
( |
const std::size_t |
count | ) |
const |
|
inlineconstexpr |
◆ max_count
std::size_t Job::Splitter::max_count = 0u |
The documentation for this struct was generated from the following file: