JuliaSIMD / JuliaSIMD/StrideArrays.jl

StrideArrays with `ComplexF32`?

Open
#85 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
59
Forks
9
PR merge metrics
No merged PRs in 30d

Description

X-ref https://github.com/MasonProtter/Bumper.jl/issues/34

cc @MasonProtter

I think there is an issue with complex input and some operators. For these it might make sense to have a fallback method available? MWE:

```julia
julia> using StrideArrays

julia> let a = StrideArray{ComplexF32}(undef, 10)
a .= 1
a .= cos.(a)
end
ERROR: MethodError: no method matching vmaterialize!(::StrideArray{…}, ::Base.Broadcast.Broadcasted{…}, ::Val{…}, ::Val{…}, ::Val{…})

Closest candidates are:
vmaterialize!(::Any, ::Any, ::Val{Mod}, ::Val{UNROLL}) where {Mod, UNROLL}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:753
vmaterialize!(::Union{Adjoint{T, A}, Transpose{T, A}}, ::BC, ::Val{Mod}, ::Val{UNROLL}, ::Val{dontbc}) where {T<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit}, N, A<:AbstractArray{T, N}, BC<:Union{Base.Broadcast.Broadcasted, LoopVectorization.Product}, Mod, UNROLL, dontbc}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:682
vmaterialize!(::AbstractArray{T, N}, ::BC, ::Val{Mod}, ::Val{UNROLL}, ::Val{dontbc}) where {T<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit}, N, BC<:Union{Base.Broadcast.Broadcasted, LoopVectorization.Product}, Mod, UNROLL, dontbc}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:673
...

Stacktrace:
[1] vmaterialize!
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:759 [inlined]
[2] _materialize!
@ StrideArrays ~/.julia/packages/StrideArrays/PeLtr/src/broadcast.jl:181 [inlined]
[3] materialize!(dest::StrideArray{…}, bc::Base.Broadcast.Broadcasted{…})
@ StrideArrays ~/.julia/packages/StrideArrays/PeLtr/src/broadcast.jl:188
[4] top-level scope
@ REPL[9]:3
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the MWE in the issue, then inspect StrideArrays/src/broadcast.jl around _materialize! and materialize!, along with the referenced LoopVectorization/src/broadcast.jl vmaterialize! methods. Determine how complex input is handled and whether a fallback is appropriate. Done means the shown ComplexF32 broadcast operations no longer raise the reported MethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.