mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-15 21:21:16 +08:00
Revert changes in pocketfft.h
This commit is contained in:
parent
b7ce3c947c
commit
27ceff33d3
10
mlx/3rdparty/pocketfft.h
vendored
10
mlx/3rdparty/pocketfft.h
vendored
@ -537,11 +537,7 @@ inline size_t &num_threads()
|
||||
static thread_local size_t num_threads_=1;
|
||||
return num_threads_;
|
||||
}
|
||||
inline const size_t &max_threads()
|
||||
{
|
||||
static thread_local const size_t max_threads_ = std::max(1u, std::thread::hardware_concurrency());
|
||||
return max_threads_;
|
||||
}
|
||||
static const size_t max_threads = std::max(1u, std::thread::hardware_concurrency());
|
||||
|
||||
class latch
|
||||
{
|
||||
@ -725,7 +721,7 @@ class thread_pool
|
||||
workers_(nthreads)
|
||||
{ create_threads(); }
|
||||
|
||||
thread_pool(): thread_pool(max_threads()) {}
|
||||
thread_pool(): thread_pool(max_threads) {}
|
||||
|
||||
~thread_pool() { shutdown(); }
|
||||
|
||||
@ -790,7 +786,7 @@ template <typename Func>
|
||||
void thread_map(size_t nthreads, Func f)
|
||||
{
|
||||
if (nthreads == 0)
|
||||
nthreads = max_threads();
|
||||
nthreads = max_threads;
|
||||
|
||||
if (nthreads == 1)
|
||||
{ f(); return; }
|
||||
|
Loading…
Reference in New Issue
Block a user