You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using Polyester.jl to thread an outer loop and wanted to SIMD the inner loop but got an error. Apparently Polyester converts vectors into StrideArraysCore.PtrArray which does not dispatch on SIMD._pointer. Below is the MWE example of the error and a fix. I'd be happy to provide the fix here but StrideArraysCore.jl is not a dependency, so thought I'd raise the issue here.
julia>using StrideArraysCore, SIMD
julia> x = StrideArraysCore.PtrArray(rand(4))
4-element PtrArray{Float64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{StaticInt{1}}}:0.53492563959069620.174317493012704160.88641817314191280.30373397033508265
julia> lane =VecRange{4}(0)
VecRange{4}(0)
julia> x[1+ lane]
ERROR: MethodError: no method matching _pointer(::PtrArray{Float64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{StaticInt{1}}}, ::Int64, ::Tuple{})
Closest candidates are:_pointer(::SubArray{T, N, P, I, true}where {T, N, P, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, ::Any, ::Tuple{})
@ SIMD ~/.julia/packages/SIMD/2fAdM/src/arrayops.jl:290_pointer(::SubArray{T, N, P, I, true}where {T, N, P, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, ::Any, ::Any)
@ SIMD ~/.julia/packages/SIMD/2fAdM/src/arrayops.jl:288_pointer(::SubArray, ::Any, ::Any)
@ SIMD ~/.julia/packages/SIMD/2fAdM/src/arrayops.jl:295...
Stacktrace:
[1] getindex(::PtrArray{Float64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{StaticInt{1}}}, ::VecRange{4})
@ SIMD ~/.julia/packages/SIMD/2fAdM/src/arrayops.jl:302
[2] top-level scope
@ REPL[4]:1
The obvious fix is
Base.@propagate_inbounds SIMD._pointer(arr::StrideArraysCore.PtrArray, i, I) =pointer(Base.unsafe_view(arr, 1, I...), i)
The text was updated successfully, but these errors were encountered:
Base.@propagate_inbounds_pointer(arr::Base.FastContiguousSubArray, i, I) =
pointer(arr, (i, I...))
would match this but perhaps this is the difference between "FastContiguousArray" and "ContiguousArray". I don't fully understand all the typealiases in that file...
I was using
Polyester.jl
to thread an outer loop and wanted to SIMD the inner loop but got an error. ApparentlyPolyester
converts vectors intoStrideArraysCore.PtrArray
which does not dispatch onSIMD._pointer
. Below is the MWE example of the error and a fix. I'd be happy to provide the fix here but StrideArraysCore.jl is not a dependency, so thought I'd raise the issue here.The obvious fix is
The text was updated successfully, but these errors were encountered: