Skip to content
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

Proposal to remove ShiftedArrays as far as possible #48

Open
roflmaostc opened this issue Nov 6, 2024 · 0 comments
Open

Proposal to remove ShiftedArrays as far as possible #48

roflmaostc opened this issue Nov 6, 2024 · 0 comments

Comments

@roflmaostc
Copy link
Member

Hi,

I'm seeing myself always writing fftshift(fft(ifftshift(x))) because CUDA compatibility.

Maybe we should do the following:

ft(x) = fftshift(fft(ifftshift(x)))


function plan_ft(x)
    buffer1 = similar(x)
    buffer2 = similar(x)
    plan = plan_fft(x)
    function p(x)
         ifftshift!(buffer, x)
         fft!(buffer)
         # or mul!(buffer, p, x)
         fftshift!(buffer2, buffer)
         return buffer2
     end
     return p

In that way, we have a naive method which works interactively and is still good in speed. Or we have an allocation free version which has also the planned FFT which is more efficient.

It would be breaking because we would need to change some code.

What do you think? For me it's just a bit sad to see that I barely use this package in differentiable, high-performance situations because it doesn't work with CUDA, AD, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant