JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Fallback path: annotate `for` loops with `@simd`?

Aperta
#182 4 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

Here's the fallback path for the basic matmul kernel:
```julia
$(Expr(:inbounds, true))
local var"#1#val" = for n = 1:size(A, 1), m = 1:size(B, 2)
#= REPL[2]:2 =#
Cₙₘ = zero(eltype(C))
#= REPL[2]:3 =#
for k = 1:size(A, 2)
#= REPL[2]:4 =#
Cₙₘ = Base.FastMath.add_fast(Cₙₘ, Base.FastMath.mul_fast(A[n, k], B[k, m]))
end
#= REPL[2]:6 =#
C[n, m] = Cₙₘ
end
$(Expr(:inbounds, :pop))
var"#1#val"
```

In the fallback path, `@inbounds` and `@fastmath` have both been applied.

Would it also make sense to annotate the `for` loop in the fallback path with `@simd`?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the fallback path for the basic matmul kernel shown in the issue and compare its existing @inbounds and @fastmath annotations with the proposed @simd annotation. Determine the relevant fallback entry point and any associated tests before changing anything; the issue names no source file or test, so completion would require validating whether the loop annotation is appropriate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
julia
Ambito
performance
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.