-
Notifications
You must be signed in to change notification settings - Fork 1
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
Question on F-order PlanNd #7
Comments
If you look at the notes section for PlanNd, you will see the following (copied from the CUDA docs):
Here: A concrete example to illustrate this:
Note that order 'F' with reversed shape at least has the same numerical values for the strides (although the order is reversed). |
I think someone had recommended this method of reversing the shape somewhere on the NVIDIA forums years ago, but I don't recall exactly where. A quick google search found the following section of a book recommending swapping nx, ny for 2D FFTs, although that is not where I originally saw the suggestion. |
Actually, it looks like the shape reversal used to be mentioned in the CUFFT docs, but I don't see it in the current ones. In this older version it states: "For higher‐dimensional transforms (2D and 3D), CUFFT performs FFTs in row‐major or C order. For example, if the user requests a 3D transform plan for sizes X, Y, and Z, CUFFT transforms along Z, Y, |
Forgot to reply here: Thanks a lot, Gregory! I was able to see that when the indices Now, I am suspecting I need to think the indexing harder for R2C/C2R. In my PR I just found F-order inputs sometimes are transformed wrong. It may not be as simple as in C2C...? |
Leaving a note for myself: Still trying to figure out how reversing array dimensions works for R2C & C2R transforms of F-order arrays. I thought it should be just a straightforward reverse, but doesn't seem like it. I had a sense that cuFFT works quite similarly as FFTW, so I looked up the FFTW doc and found the same suggestion for dimension reverse: |
I think cuFFT R2C/C2R is probably buggy for 2D transform + F-order...For 3D the shape reversal trick works just fine. 😞 |
Found something interesting. Let me redirect the discussion back to my PR cupy#3102. |
For my own note: I found this on FFTW's doc:
See http://www.fftw.org/fftw3_doc/Multi_002ddimensional-Transforms.html#Multi_002ddimensional-Transforms. "Separable product of 1d transforms along each dimension" is what's done in NumPy. So I wonder if this is the real cause of mismatch between NumPy and cuFFT (suppose cuFFT follows closely what's done in FFTW)... |
@grlee77 I have a quick question on lines like this:
cupy/cupy/fft/fft.py
Lines 287 to 288 in fa83171
I am having trouble understanding why it works. Could you explain to me? Thanks!
The text was updated successfully, but these errors were encountered: