JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Doesn't seem to handle Bool negation well

Offen
#99 3 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
789
Forks
73
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi, just trying `@avx` for the first time on a simple loop that includes the negation of a boolean:
```
julia> xs = rand(10)

julia> function foo(x)
count = 0
@avx for i in eachindex(x)
count += !isnan(x[i])
end
count
end
foo (generic function with 1 method)

julia> foo(xs)
ERROR: MethodError: no method matching !(::UInt8)
Closest candidates are:
!(::Missing) at missing.jl:100
!(::Bool) at bool.jl:35
!(::Function) at operators.jl:880
...

```
Is that expected?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduce the reported `foo` loop with `@avx`, `eachindex`, and `!isnan(x[i])`, then inspect the handling of boolean negation in the vectorization path. Done means determining whether this usage should work and documenting or correcting the behavior accordingly.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia
Bereich
performance
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.