JuliaSIMD / JuliaSIMD/LoopVectorization.jl
Cannot vectorize a loop with inner hidden loop (findfirst)
- Vorherrschende Sprache
- Julia
- Sterne
- 789
- Forks
- 73
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I have a simple algorithm that I want to vectorize. Works with `@simd` but for `@avx` throws an error that x is not defined.
```julia
function check_simd(regex_list, input)
input_len=length(input)
icon_indices = Vector{Int64}(undef, input_len)
@avx for j=1:input_len
icon_indices[j] = findfirst(x-> match(x, input[j]) !== nothing, regex_list)
end
return icon_indices
end
```
MWE here: https://gist.github.com/aminya/4b6e6db1147e63727cffc781633a8e0b
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Reproduce the MWE from the linked gist in the JuliaSIMD/LoopVectorization.jl issue, focusing on the @avx loop, its inner findfirst call, and the reported undefined x error. Compare the behavior with @simd; done means the reported case is handled correctly or the limitation is documented with a clear explanation.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- julia
- Bereich
- performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100