Skip to content

Proposal to remove ShiftedArrays as far as possible #48

@roflmaostc

Description

@roflmaostc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions