JuliaSIMD / JuliaSIMD/LoopVectorization.jl
AssertionError: length(exargs) == 2 for simple loop
- Dominant language
- Julia
- Stars
- 789
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
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
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.