Suggestion: infer plan type from `x` type
- Dominant language
- Julia
- Stars
- 156
- Forks
- 29
- Avg merge
- 8h 57m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.