If I understand correctly, the current approach is that user decides between cpu and gpu versions by either
- CPU:
p = plan_nfft(x, N) or (currently equivalently I think) p = plan_nfft(Array, x, N)
- GPU:
p = plan_nfft(CuArray, x, N)
I'd prefer that the default plan type come from the type of x by adding a method something like
plan_nfft(x, N) = plan_nfft(typeof(x), x, N)
So if x is a CuArray then by default the plan will be a GPU plan.
The reason is that then I can embed plan_nfft into downstream packages without forcing them to depend on CUDA.jl.
This might also "future proof" it so that someday when we have a OpenCLArray version then again it can inherit from x.
But I might be missing something?
And I have not really been able to test it out yet because I think the recent CUDA fixes are waiting for release updates.
I realize that if x is an Adjoint type (or a Range) then this would need additional work to get at the "base" of such types.
If I understand correctly, the current approach is that user decides between cpu and gpu versions by either
p = plan_nfft(x, N)or (currently equivalently I think)p = plan_nfft(Array, x, N)p = plan_nfft(CuArray, x, N)I'd prefer that the default plan type come from the type of
xby adding a method something likeplan_nfft(x, N) = plan_nfft(typeof(x), x, N)So if
xis aCuArraythen by default the plan will be a GPU plan.The reason is that then I can embed
plan_nfftinto downstream packages without forcing them to depend on CUDA.jl.This might also "future proof" it so that someday when we have a OpenCLArray version then again it can inherit from
x.But I might be missing something?
And I have not really been able to test it out yet because I think the recent CUDA fixes are waiting for release updates.
I realize that if
xis anAdjointtype (or a Range) then this would need additional work to get at the "base" of such types.