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

Errors when using with LoopVectorization #72

Open
grahamas opened this issue Mar 23, 2021 · 0 comments
Open

Errors when using with LoopVectorization #72

grahamas opened this issue Mar 23, 2021 · 0 comments

Comments

@grahamas
Copy link

grahamas commented Mar 23, 2021

This might be the same as #69, but I thought I'd check anyway. Just let me know if I should post elsewhere. Alternatively it could be because LoopVectorization only works with unit stride? I sort of assumed that wouldn't matter here since the underlying stride is still 1.

using AxisIndices, LoopVectorization
x = rand(5)
@avx x .*= 5  # works
y = AxisArray(rand(5), 1:5)
@avx y .*= 5  # errors below
@avx y .* 5  # similar error below
ERROR: MethodError: no method matching stridedpointer(::Ptr{Float64}, ::ArrayInterface.Contiguous{1}, ::Nothing, ::Nothing, ::Tuple{ArrayInterface.StaticInt{8}}, ::Tuple{ArrayInterface.StaticInt{1}})
Closest candidates are:
  stridedpointer(::Ptr{T}, ::ArrayInterface.Contiguous{C}, ::ArrayInterface.ContiguousBatch{B}, ::ArrayInterface.StrideRank{R}, ::X, ::O) where {T<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, VectorizationBase.Bit}, C, B, R, N, X<:Tuple{Vararg{Any, N}}, O<:Tuple{Vararg{Any, N}}} at /home/graham/.julia/packages/VectorizationBase/qmYqb/src/strided_pointers/stridedpointers.jl:74
Stacktrace:
 [1] stridedpointer
   @ ~/.julia/packages/VectorizationBase/qmYqb/src/strided_pointers/stridedpointers.jl:72 [inlined]
 [2] stridedpointer_for_broadcast
   @ ~/.julia/packages/LoopVectorization/Dz04L/src/broadcast.jl:2 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/LoopVectorization/Dz04L/src/broadcast.jl:357 [inlined]
 [4] vmaterialize!(dest::AxisVector{Float64, Vector{Float64}, Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}}, bc::Base.Broadcast.Broadcasted{AxisIndices.AxisArrayStyle{Base.Broadcast.DefaultArrayStyle{1}}, Nothing, typeof(*), Tuple{AxisVector{Float64, Vector{Float64}, Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}}, Int64}}, #unused#::Val{:Main})
   @ LoopVectorization ~/.julia/packages/LoopVectorization/Dz04L/src/broadcast.jl:357
 [5] top-level scope
   @ REPL[9]:1
ERROR: MethodError: no method matching similar(::Base.Broadcast.Broadcasted{AxisIndices.AxisArrayStyle{Base.Broadcast.DefaultArrayStyle{1}}, Nothing, typeof(*), Tuple{AxisVector{Float64, Vector{Float64}, Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}}, Int64}}, ::Type{Float64}, ::Tuple{Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}})
Closest candidates are:
  similar(::AxisArray, ::Type{T}, ::Tuple{AbstractUnitRange, Vararg{AbstractUnitRange, N} where N}) where T at /home/graham/.julia/dev/AxisIndices/src/abstractarray.jl:138
  similar(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{N}, Axes, F, Args} where {Axes, F, Args<:Tuple}, ::Type{ElType}, ::Any) where {N, ElType} at broadcast.jl:197
  similar(::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayConflict, Axes, F, Args} where {Axes, F, Args<:Tuple}, ::Type{ElType}, ::Any) where ElType at broadcast.jl:202
  ...
Stacktrace:
 [1] similar(bc::Base.Broadcast.Broadcasted{AxisIndices.AxisArrayStyle{Base.Broadcast.DefaultArrayStyle{1}}, Nothing, typeof(*), Tuple{AxisVector{Float64, Vector{Float64}, Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}}, Int64}}, #unused#::Type{Float64})
   @ Base.Broadcast ./broadcast.jl:196
 [2] vmaterialize(bc::Base.Broadcast.Broadcasted{AxisIndices.AxisArrayStyle{Base.Broadcast.DefaultArrayStyle{1}}, Nothing, typeof(*), Tuple{AxisVector{Float64, Vector{Float64}, Axis{Float64, Int64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, SimpleAxis{Int64, StaticRanges.OneToMRange{Int64}}}}, Int64}}, #unused#::Val{:Main})
   @ LoopVectorization ~/.julia/packages/LoopVectorization/Dz04L/src/broadcast.jl:435
 [3] top-level scope
   @ REPL[10]: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