Revert changes in pocketfft.h

This commit is contained in:
Hanyu Deng 2025-04-10 22:37:36 +08:00 committed by Awni Hannun
parent b7ce3c947c
commit 27ceff33d3

View File

@ -537,11 +537,7 @@ inline size_t &num_threads()
static thread_local size_t num_threads_=1; static thread_local size_t num_threads_=1;
return num_threads_; return num_threads_;
} }
inline const size_t &max_threads() static const size_t max_threads = std::max(1u, std::thread::hardware_concurrency());
{
static thread_local const size_t max_threads_ = std::max(1u, std::thread::hardware_concurrency());
return max_threads_;
}
class latch class latch
{ {
@ -725,7 +721,7 @@ class thread_pool
workers_(nthreads) workers_(nthreads)
{ create_threads(); } { create_threads(); }
thread_pool(): thread_pool(max_threads()) {} thread_pool(): thread_pool(max_threads) {}
~thread_pool() { shutdown(); } ~thread_pool() { shutdown(); }
@ -790,7 +786,7 @@ template <typename Func>
void thread_map(size_t nthreads, Func f) void thread_map(size_t nthreads, Func f)
{ {
if (nthreads == 0) if (nthreads == 0)
nthreads = max_threads(); nthreads = max_threads;
if (nthreads == 1) if (nthreads == 1)
{ f(); return; } { f(); return; }