-
Notifications
You must be signed in to change notification settings - Fork 548
Address issues with modified inputs for fftC2R functions. #2520
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
Conversation
@@ -121,7 +121,7 @@ void fft_r2c(Param<Tc> out, const af::dim4 oDataDims, CParam<Tr> in, | |||
plan = transform.create(rank, t_dims, (int)batch, (Tr *)in.get(), in_embed, | |||
(int)istrides[0], (int)istrides[rank], | |||
(ctype_t *)out.get(), out_embed, (int)ostrides[0], | |||
(int)ostrides[rank], FFTW_ESTIMATE); | |||
(int)ostrides[rank], FFTW_ESTIMATE | FFTW_PRESERVE_INPUT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this flag alone enough to fix the problem? Why copy the array yet again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works in real to complex ffts. The complex 2 real function will return a NULL plan because FFTW does not have an algorithm for this.
FFTW_PRESERVE_INPUT specifies that an out-of-place transform must not change its input array. This is ordinarily the default, except for c2r and hc2r (i.e. complex-to-real) transforms for which FFTW_DESTROY_INPUT is the default. In the latter cases, passing FFTW_PRESERVE_INPUT will attempt to use algorithms that do not destroy the input, at the expense of worse performance; for multi-dimensional c2r transforms, however, no input-preserving algorithms are implemented and the planner will return NULL if one is requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes! I'm so glad ArrayFire has separate functions for in-place transforms and it is clear from the name of the function of what to expect.
80a4b22
to
c2de685
Compare
Removed tests that were failing on CUDA 10.1. Should be added back once the bug is resolved. |
4ad7b99
to
383486d
Compare
The fftC2R function was modifying the input array when the fftw library was used. This was happening because the fftw library does not have and algorithm that can compute the fft without modifying the input array. This problem does not seem to be happening on the MKL based fft.
to_test_params); | ||
|
||
// Does not work well with CUDA 10.1 | ||
// TEST_P(FFTC2R2D, Complex32ToRealInputsPreserved) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a major requirement, we should lean towards using DISABLED_
prefix for the test so that it is reported as disabled in ctest suite runs.
The fftC2R function was modifying the input array when the fftw library
was used. This was happening because the fftw library does not have
and algorithm that can compute the fft without modifying the input array.
This problem does not seem to be happening on the MKL based fft.
Fixes #2518 For the CPU backend. I haven't been able to reproduce this with
the cuda backend.