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

Support the strided array interface #218

Open
dlfivefifty opened this issue Sep 29, 2021 · 0 comments
Open

Support the strided array interface #218

dlfivefifty opened this issue Sep 29, 2021 · 0 comments

Comments

@dlfivefifty
Copy link
Member

Note that Julia supports a strided array interface. At the moment FFTW only works with StridedArray which means other types can't use it, see below example.

I assume this is an easy fix and just replace ::StridedArray with ::AbstractArray, as non-compatible types will error out on the call to pointer.

julia> using BlockArrays

julia> n = 10; x = PseudoBlockArray(randn(n), [5,5])
2-blocked 10-element PseudoBlockVector{Float64}:
  0.13895184669862432
  1.0296194237071945 
  0.831728129597864  
 -1.2760605104194878 
  1.225360630804565  
 ────────────────────
  2.9373002173159604 
 -0.20348560029959115
  1.3919462067161756 
 -0.5452870826131355 
  0.6774104064065777 

julia> strides(x)
(1,)

julia> pointer(x)
Ptr{Float64} @0x0000000141ab5770

julia> F = FFTW.plan_r2r(randn(n), FFTW.REDFT00);

julia> lmul!(randn(n), F, x)
ERROR: MethodError: no method matching lmul!(::Vector{Float64}, ::FFTW.r2rFFTWPlan{Float64, (3,), false, 1, UnitRange{Int64}}, ::PseudoBlockVector{Float64, Vector{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}}})
Stacktrace:
 [1] top-level scope
   @ REPL[9]:1
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