Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
thread.h File Reference
#include <BS_thread_pool.hpp>
#include <cstddef>
#include <optional>
#include <thread>
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  clustering::math::Pool
 Thin injection wrapper around a BS::light_thread_pool. More...

Namespaces

namespace  clustering
namespace  clustering::math

Functions

std::size_t clustering::math::clampedJobCount (std::size_t nJobs) noexcept
 Clamp a caller-supplied nJobs to a valid BS::light_thread_pool worker count.
bool clustering::math::shouldSpawnPool (std::size_t totalOps, std::size_t nJobs, std::size_t minOpsPerWorker=std::size_t{1}<< 15) noexcept
 Decide whether spawning a pool with nJobs workers is worth it for totalOps of arithmetic work.