-
-
Notifications
You must be signed in to change notification settings - Fork 740
Fix dlang#10798 — Reimplement FFT solver to support @nogc nothrow pure @safe
#10799
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
base: master
Are you sure you want to change the base?
Conversation
Unlike `Fft`, this can be used in `@nogc` code.
Thanks for your pull request and interest in making D better, @Ogi-kun! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10799" |
The type and the size of a lookup table is an implementation detail.
@nogc nothrow pure @safe
FFT
. It either allocates a buffer for a lookup table usingmalloc
, or uses a preallocated buffer. In the former case, the buffer is freed upon destruction.FFT
is non-copyable.Fft
class now is just a wrapper aroundFFT
.FFT
instead ofFft
. In effect,fft(R, Ret)
andinverseFft(R, Ret)
can be used in@nogc
,nothrow
,pure
and@safe
code.Though the optimization of the algorithm itself was not the goal of this change, the new version performs slightly better on the larger FFT sizes. Using LDC2 with
-O -release
flags, on size=64FFT.compute
works about as fast as the oldFft.fft
, and on size=32768 it works 6-7 % faster. DMD shows similar results.