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

TypeError in typeassert in loop with view #365

Open
omlins opened this issue Nov 17, 2021 · 0 comments
Open

TypeError in typeassert in loop with view #365

omlins opened this issue Nov 17, 2021 · 0 comments

Comments

@omlins
Copy link

omlins commented Nov 17, 2021

This MWE

using LoopVectorization

A          = [iz*1e2 + iy*1e1 + ix for ix=1:7, iy=1:5, iz=1:6];
sendbuf    = zeros(size(A,2), size(A,3));
ix, iy, iz = 2, 1:size(A,2), 1:size(A,3);

dst = view(sendbuf,:);
src = view(view(A,ix, :, :),:);

@tturbo for ix = 1:length(dst)
    dst[ix] = src[ix]
end

produces the following error:

julia> using LoopVectorization

julia> A          = [iz*1e2 + iy*1e1 + ix for ix=1:7, iy=1:5, iz=1:6];

julia> sendbuf    = zeros(size(A,2), size(A,3));

julia> ix, iy, iz = 2, 1:size(A,2), 1:size(A,3);

julia> dst = view(sendbuf,:);

julia> src = view(view(A,ix, :, :),:);

julia> @tturbo for ix = 1:length(dst)
           dst[ix] = src[ix]
       end
ERROR: TypeError: in typeassert, expected Tuple{Int64}, got a value of type Nothing
Stacktrace:
 [1] (ArrayInterface.StrideIndex{1, nothing, nothing, S, O} where {S, O})(s::Tuple{Static.StaticInt{1}}, o::Tuple{Static.StaticInt{1}})
   @ ArrayInterface ~/.julia/packages/ArrayInterface/W1AVE/src/array_index.jl:197
 [2] (ArrayInterface.StrideIndex{1, nothing, nothing, S, O} where {S, O})(a::SubArray{Float64, 1, Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}}, true})
   @ ArrayInterface ~/.julia/packages/ArrayInterface/W1AVE/src/array_index.jl:200
 [3] ArrayInterface.StrideIndex(a::SubArray{Float64, 1, Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}}, true})
   @ ArrayInterface ~/.julia/packages/ArrayInterface/W1AVE/src/array_index.jl:203
 [4] bytestrideindex
   @ ~/.julia/packages/LayoutPointers/fHXhH/src/stridedpointers.jl:61 [inlined]
 [5] stridedpointer_preserve(A::SubArray{Float64, 1, Base.ReshapedArray{Float64, 1, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}}, true})
   @ LayoutPointers ~/.julia/packages/LayoutPointers/fHXhH/src/stridedpointers.jl:73
 [6] top-level scope
   @ ./REPL[7]: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