JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Error caused by `Static.StaticInt` not being an `Integer`

Aperta
#417 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
789
Fork
73
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I get the following error (on Julia v1.7.2):
```julia
julia> using Pkg; Pkg.activate(temp=true); Pkg.add("LoopVectorization")
...
[bdcacae8] + LoopVectorization v0.12.119
...
[aedffcd0] + Static v0.7.4
...

julia> function foo_plain!(dst, src)
for i in (firstindex(dst, 2) + 1):(lastindex(dst, 2) - 1)
dst[1, i] = src[1, i]
end
dst
end
foo_plain! (generic function with 1 method)

julia> src = ones(6, 6); dst = zero(src)
6×6 Matrix{Float64}:
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0

julia> foo_plain!(dst, src)
6×6 Matrix{Float64}:
0.0 1.0 1.0 1.0 1.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0

julia> using LoopVectorization

julia> function foo_turbo!(dst, src)
@turbo for i in (firstindex(dst, 2) + 1):(lastindex(dst, 2) - 1)
dst[1, i] = src[1, i]
end
dst
end
foo_turbo! (generic function with 1 method)

julia> foo_turbo!(dst, src)
ERROR: TypeError: in typeassert, expected Integer, got a value of type Static.StaticInt{2}
Stacktrace:
[1] axes
@ ./abstractarray.jl:74 [inlined]
[2] firstindex
@ ./abstractarray.jl:396 [inlined]
[3] foo_turbo!(dst::Matrix{Float64}, src::Matrix{Float64})
@ Main ./REPL[9]:2
[4] top-level scope
@ REPL[10]:1
```
How would you recommend to solve this?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.