-
Notifications
You must be signed in to change notification settings - Fork 28
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
@Turbo failing #125
Comments
I'm surprised that fails, it's so simple. But maybe something is tripping over the type of |
Bizarrely, it's disappeared now. I have no idea what changed and fixed this, but I can't reproduce it anymore. |
Oh weird, it's popping up again. Maybe I just missed it? Here's the warning:
|
The warning will only print once by default. You can make it appear more often via |
Ideally Tullio's own check should not send LV things it can't handle. But perhaps it can be made smarter. What are the types of the arrays here? |
I should probably have LV's warnings print those. |
The arrays are just normal Base arrays of |
Okay, that's why. julia> using LoopVectorization, AxisKeys
julia> A = KeyedArray(rand(2,10), ([:a, :b], 10:10:100))
2-dimensional KeyedArray(...) with keys:
↓ 2-element Vector{Symbol}
→ 10-element StepRange{Int64,...}
And data, 2×10 Matrix{Float64}:
(10) (20) (30) (40) (50) (60) (70) (80) (90) (100)
(:a) 0.498766 0.363857 0.313591 0.303895 0.453926 0.0574657 0.443101 0.179118 0.39422 0.946817
(:b) 0.0080239 0.544323 0.983931 0.0620305 0.589515 0.903863 0.114999 0.816759 0.377231 0.306352
julia> LoopVectorization.check_args(A)
false For an array type to be supported, it must implement the If |
Oh, hmm, that's surprising. It looks like it doesn't work with DimensionalData either. @rafaqz |
@chriselrod what ArrayInterface.jl methods do we have to implement for this to work? |
If it's just a simple wrapper, then all that is needed is ArrayInterface.parent_type(::Type{<:YourArrayWrapper}) = ... For example: julia> using AxisKeys, ArrayInterface, LoopVectorization
julia> A = KeyedArray(rand(2,10), ([:a, :b], 10:10:100))
2-dimensional KeyedArray(...) with keys:
↓ 2-element Vector{Symbol}
→ 10-element StepRange{Int64,...}
And data, 2×10 Matrix{Float64}:
(10) (20) (30) (40) (50) (60) (70) (80) (90) (100)
(:a) 0.0677124 0.755331 0.558675 0.213256 0.719723 0.195234 0.0587435 0.866621 0.42191 0.156516
(:b) 0.761694 0.135312 0.386402 0.54806 0.994232 0.730863 0.128959 0.898721 0.971936 0.971892
julia> ArrayInterface.parent_type(::Type{<:KeyedArray{T,N,A}}) where {T,N,A} = A
julia> LoopVectorization.check_args(A)
true
julia> stridedpointer(A)
LayoutPointers.StridedPointer{Float64, 2, 1, 0, (1, 2), Tuple{Static.StaticInt{8}, Int64}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}}(Ptr{Float64} @0x00007f1f3a82f5a0, ArrayInterface.StrideIndex{2, (1, 2), 1, Tuple{Static.StaticInt{8}, Int64}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}}((static(8), 16), (static(1), static(1))))
julia> stridedpointer(A) === stridedpointer(parent(A))
true |
For some reason,
@turbo
throws a warning here at this specific line in my code. (Note that this was failing before I made a PR that setavx=false
to silence the warning for users.) I have no idea what's going on. I haven't been able to build a MWE because from what I can see the line is so simple that I feel like it should definitely be running; it's probably to do with some weird edge case that I can't isolate without knowing the internals of@tullio
.The text was updated successfully, but these errors were encountered: