|
| unsigned | mtl::parallel::pool_local_noexc::detail::clamp_pool_threads (unsigned long v) |
| | Clamp a requested thread count to [1, hardware concurrency].
|
| bool | mtl::parallel::pool_local_noexc::detail::env_unsigned (const char *name, unsigned &out) |
| | Read environment variable name as a whole unsigned decimal: digits only, no sign, space or trailing characters, at most 0xFFFFFFFF.
|
| unsigned | mtl::parallel::pool_local_noexc::detail::resolve_pool_threads () |
| | Resolve the pool size from MTL5_NUM_THREADS (clamped to hardware concurrency); 1 when unset/invalid (see env_unsigned).
|
| pool_config & | mtl::parallel::pool_local_noexc::detail::config () |
| region_thread & | mtl::parallel::pool_local_noexc::detail::this_region_thread () noexcept |
| bool | mtl::parallel::pool_local_noexc::detail::in_region () noexcept |
| | True while this thread runs a tid of an MTL5 region (see the contract at the top of this header).
|
| bool | mtl::parallel::pool_local_noexc::detail::on_pool_worker () noexcept |
| | True on the pool's worker threads, which are inside a region whenever they run anything at all.
|
| unsigned | mtl::parallel::pool_local_noexc::detail::claim_pool_size () |
| unsigned | mtl::parallel::pool_local_noexc::detail::team_for (std::size_t n, std::size_t grain, unsigned max_threads, unsigned pool_size) noexcept |
| | Team for a chunked loop over n units on a pool of pool_size: the pool, or max_threads if that is smaller and nonzero, cut so each chunk holds >= grain units; 1 (serial) when the pool is serial or n < 2 * grain.
|
| template<typename Pool, typename Body> |
| void | mtl::parallel::pool_local_noexc::detail::chunked_for (Pool &pool, std::size_t n, std::size_t grain, unsigned max_threads, Body &&body) |
| | parallel_for on pool; see thread_pool::parallel_for.
|
| template<typename T, typename Pool, typename MapFn> |
| T | mtl::parallel::pool_local_noexc::detail::chunked_reduce (Pool &pool, std::size_t n, std::size_t grain, unsigned max_threads, MapFn &&map) |
| | parallel_reduce on pool; see thread_pool::parallel_reduce.
|
| template<typename Acc, typename Pool, typename InitFn, typename MapFn, typename CombineFn> |
| Acc | mtl::parallel::pool_local_noexc::detail::chunked_accumulate (Pool &pool, std::size_t n, std::size_t grain, unsigned max_threads, InitFn &&init, MapFn &&map, CombineFn &&combine) |
| | parallel_accumulate on pool; see thread_pool::parallel_accumulate.
|
| void | mtl::parallel::pool_local_noexc::detail::cpu_relax () noexcept |
| | One spin-wait iteration: a pause hint to the core, nothing else.
|
| void | mtl::parallel::pool_local_noexc::detail::spin_step (unsigned i) noexcept |
| | One iteration of a spin wait: a pause, and every 64th iteration a yield, so a thread the scheduler has queued on this core behind the spinner runs within a few microseconds instead of after the whole spin.
|
| default_pool & | mtl::parallel::pool_local_noexc::pool_select_thread::pool () |
| | The process-wide pool that MTL5's kernels run on.
|
| bool | mtl::parallel::pool_local_noexc::configure (unsigned threads) |
| | Size the process-wide pool from code, instead of MTL5_NUM_THREADS.
|