JuliaSIMD / JuliaSIMD/LoopVectorization.jl
AssertionError: length(exargs) == 2 for simple loop
- Lenguaje dominante
- Julia
- Estrellas
- 789
- Forks
- 73
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I can't figure out what's wrong with the expression below. I've tried replacing `CartesianIndices` with eachindex but the error remains
```julia
function ot_cost(u,K,v,β=1)
c = 0.0
lu = log.(u)
lv = log.(v)
@avx for I in CartesianIndices(u)
for J in CartesianIndices(v)
t = (I-J).I
d = (t[1]^2+t[2]^2)
c += d*(exp(-d/β + lu[I] + lv[J]))
end
end
c
end
```
the error appears to come from the line `c += d*(exp(-d/β + lu[I] + lv[J]))` and it goes away if that line is removed.
Full error
```
LoadError: AssertionError: length(exargs) == 2
in expression starting at /home/fredrikb/Desktop/visual_similarity.jl:83
recursive_mul_search!(::Expr, ::Array{Any,1}, ::Bool, ::Bool) at contract_pass.jl:36
recursive_mul_search! at contract_pass.jl:30 [inlined]
capture_muladd(::Expr, ::Nothing) at contract_pass.jl:99
contract!(::Expr, ::Expr, ::Int64, ::Nothing) at contract_pass.jl:128
contract_pass! at contract_pass.jl:152 [inlined]
contract_pass! at contract_pass.jl:150 [inlined]
LoopVectorization.LoopSet(::Expr, ::Symbol) at constructors.jl:46
LoopVectorization.LoopSet(::Expr, ::Module) at constructors.jl:52
@avx(::LineNumberNode, ::Module, ::Any) at constructors.jl:91
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the @avx entry point in constructors.jl and follow the reported stack trace into contract_pass.jl, especially recursive_mul_search!, capture_muladd, and contract!. Reproduce the nested CartesianIndices loop using the expression at the c += line, then determine what input causes the length(exargs) == 2 assertion. Done means the expression is handled without the assertion while preserving the loop's result.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- julia
- Área
- performance
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100