You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add get_num_threads
This commit adds `get_num_threads`, which returns the number of threads used by
the planner, and is the complement to `set_num_threads`. This simply wraps the
function `fftw_planner_nthreads`, which was
[newly added to fftw in version 3.3.9](https://github.com/FFTW/fftw3/blob/34082eb5d6ed7dc9436915df69f376c06fc39762/NEWS#L3).
* Set FFTW_jll compat to 3.3.9
`get_num_threads` requires FFTW_jll v3.3.9+7, but it doesn't seem possible to
specify a particular build in the compat section of Project.toml files. However,
this should work in most cases, as the most recent build of `FFTW_jll` should be
downloaded upon updating.
* bump to 1.3 for the new function
* Make test for get_num_threads fftw specific
No equivalent function for mkl
* Typo...
* another typo
* Add vendor check to `get_num_threads`
* Add a method of `set_num_threads` that restores the original nthreads
Additionally, separate previous `set_num_threads` method into a base function,
`_set_num_threads`, that wraps the `ccalls`, and `set_num_threads`, which will
acquire the `fftwlock`.
* Provide support for `get_num_threads` with MKL's FFTW
While MKL's FFTW does not provide access to the number of threads available to
the planner, this can be simulated by caching the value last passed to
`set_num_threads` and returning it with `get_num_threads` if
`fftw_vendor == :mkl`.
* Implement suggestions of @stevengj
* Fix typo in set_num_threads
* Add test for set_num_threads method that restores original num_threads
* Rename `nthreads` variable to `num_threads` to avoid shadowing Threads.nthreads
Since FFTW uses `Base.Threads`, and `nthreads` is a function defined in
`Base.Threads`, then the function argument `nthreads` shadows a function already
in the namespace of every function. While there is no inherent issue with this,
it can make debugging this code more confusing.
* Make one-line method of `set_num_threads` one line.
* First attempt at adding `num_threads` to `plan_...` functions
As suggested by @stevengj, I have add a `num_threads` keyword to the `plan_...`
functions. My approach here is fairly naive, and adds a bunch of redundant
boiler plate code to every `plan_` function.
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Mosè Giordano <[email protected]>
0 commit comments