-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible enable multi-threading in RustFFT? #117
Comments
This could be done by adding a variant of the MixedRadix algorithm that uses rayon iterators instead of normal iterators for its inner width/height FFTs, and a custom transpose path that uses the rayon recursion feature. Then edit the planner to swap the topmost MixedRadix step with the multithreaded version. For Radix4, making that be multithreaded would be nontrivial. But what we could do is inject a ParallelMixedRadix step to divide the radix4 into 8 or 16 smaller radix4s. And a similar process would need to be done for the AVX code path. I'm not against it, the current architecture is explicitly designed to be highly modular to make changes like this possible, but it would be a relatively big undertaking. |
Quick, somewhat related question: Is RustFFT thread-safe? (noting that FFTW is not thread-safe) |
Instances of the FFT trait are completely thread safe. Instance of the
FftPlanner require &mut self in order to call the plan() methods, so
planners have to be stored inside a mutex in order to be used from multiple
threads.
It is 100% thread safe to use one planner instance from one thread, and
simultaneously use another planner instance from another thread
…On Tue, Apr 23, 2024 at 4:09 PM Dorival Pedroso ***@***.***> wrote:
Quick, somewhat related question: Is RustFFT thread-safe? (noting that
FFTW is *not* thread-safe)
—
Reply to this email directly, view it on GitHub
<#117 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI2M6SPYPWW5V6JBPGEESLY63S2BAVCNFSM6AAAAAAW54WNU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTGYZTENZTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Currently, fftw has a multi-threading option
Is it possible enable multi-threading in RustFFT?
I searched for keywords like
parallel
andthread
but found nothing.And a simple test shows a only 100% CPU time, which means RustFFT does not enable multi-threading by default.
Would RustFFT support multi-threading in the future?
The text was updated successfully, but these errors were encountered: