5#include <rexlib/core/platform/dynamic_shared_object.h>
15class thread_pool_implementation;
48 void (*)(
const void *context, std::size_t begin, std::size_t
end);
113 std::
size_t grain_size,
137 std::unique_ptr<thread_pool_implementation> m_implementation;
A fixed set of threads a loop's iterations are spread over.
Definition thread_pool.hpp:38
void(*)(const void *context, std::size_t begin, std::size_t end) body_function
The type-erased body of a parallel loop.
Definition thread_pool.hpp:48
static std::size_t get_default_worker_count()
How many workers a pool spawns when nothing else says otherwise.
void run(std::size_t count, std::size_t grain_size, body_function body, const void *context)
Run a loop, splitting it across this pool.
std::size_t get_size() const noexcept
Get the number of threads a job is spread over.
thread_pool(std::size_t worker_count)
Construct a pool with a given number of worker threads.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
REXLIB_CONSTEXPR std::size_t end() noexcept
Get the value representing the end of an array to be used as count.
@ cpu
CPU of the host node.