JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Reduction not found

Aperta
#528 2 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

Hi, here is a MWE of an unexpected error:

```
using LoopVectorization

function test(a, b)
#s = 0.0
@turbo for i in axes(a,1)
ai = 0.0
for j in axes(b,2)
bij = b[i, j]
ai += bij^2
end
ai = exp(ai)
a[i] = ai
end
return nothing
end

a = rand(256)
b = rand(256, 256)
test(a, b)
```

LoadError: LoadError: "Reduction not found."
Stacktrace:
[1] reduction_zero
@ $HOME\.julia\packages\LoopVectorization\7gWfp\src\modeling\costs.jl:649 [inlined]
[2] add_reduction_update_parent!(vparents::Vector{LoopVectorization.Operation}, deps::Vector{Symbol}, reduceddeps::Vector{Symbol}, ls::LoopVectorization.LoopSet, parent::LoopVectorization.Operation, instr::LoopVectorization.Instruction, reduction_ind::Int64, elementbytes::Int64)
@ LoopVectorization $HOME\.julia\packages\LoopVectorization\7gWfp\src\parse\add_compute.jl:255



If I use `a[i] = exp(ai)` instead of the last two lines, it works. It also works if the last two lines are `ai = exp(ai/2); a[i] = ai`. I feel the issue is related to your explanation in #498, but honestly I don't fully understand that. My general feeling there is that the error it gives is unnecessary and can be ignored if it can run... Is that correct?

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.