diff --git a/test/cfoa/helpers.hpp b/test/cfoa/helpers.hpp index 7ff48334..a9c27121 100644 --- a/test/cfoa/helpers.hpp +++ b/test/cfoa/helpers.hpp @@ -21,8 +21,10 @@ #include #include #include +#include -constexpr std::size_t const num_threads = 16; +static std::size_t const num_threads = + std::max(2u, std::thread::hardware_concurrency()); struct transp_hash { @@ -326,7 +328,7 @@ std::vector > split( template void thread_runner(std::vector& values, F f) { - boost::latch latch(num_threads); + boost::latch latch(static_cast(num_threads)); std::vector threads; auto subslices = split(values, num_threads);