mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-16 05:41:14 +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;
|
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; }
|
||||||
|
Loading…
Reference in New Issue
Block a user