ClikaRT::threading
namespace
Classes
| Name | Description |
|---|---|
ThreadPool | A handle to ClikaRT's thread pool. Get the process-wide pool with get_thread_pool(). The default ctor is hidden; handles only come from the factory. Copyable and cheap (shares the underlying pool). |
Functions
get_thread_pool()
ThreadPool get_thread_pool()
The process-wide thread pool that ClikaRT's compute runs on. Declared before the class so the in-class friend declaration is a redeclaration of an already-exported function (a friend cannot carry the export marker, and adding it only on a later declaration is ill-formed on PE).
Declared in ClikaRT/threading/threading.h, line 31
parallel_for()
void parallel_for(
std::int64_t begin,
std::int64_t end,
std::int64_t grain,
std::function<void(std::int64_t begin, std::int64_t end)> body
)
Declared in ClikaRT/threading/threading.h, line 86
schedule()
void schedule(std::function<void()> work)
Fire-and-forget work on the process-wide pool (convenience for get_thread_pool().schedule(work)). Same containment contract as ThreadPool::schedule.
Declared in ClikaRT/threading/threading.h, line 105
num_threads()
unsigned num_threads()
The process-wide pool's current worker count. Configure it with the CLIKA_RT_NUM_THREADS environment variable (read when the pool is first created); it defaults to the host's physical-core count.
Declared in ClikaRT/threading/threading.h, line 121
num_physical_cores()
unsigned num_physical_cores()
Number of physical CPU cores on the host.
Declared in ClikaRT/threading/threading.h, line 124
num_logical_cores()
unsigned num_logical_cores()
Number of logical CPU cores on the host (physical cores × SMT siblings).
Declared in ClikaRT/threading/threading.h, line 127