JuliaSIMD / JuliaSIMD/LoopVectorization.jl
BitArray support?
- Vorherrschende Sprache
- Julia
- Sterne
- 789
- Forks
- 73
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
In some cases, @ turbo is far slower on BitArrays than on anything else, and in other cases check_args fails and the vectorization doesn't happen. I can't replicate the check_args failing, but will return with an MWE when I figure that out.
```julia
using LoopVectorization, BenchmarkTools
D = rand(10000, 20000); D_bit = D .> .5; D_bool = Array{Bool}(D_bit)
function test_sum_turbo(data::D) where {T, D <: AbstractArray{T,2}}
contribution = 0
@turbo for n ∈ axes(data, 1), t ∈ axes(data, 2)
contribution += data[n,t]
end
return contribution
end
julia> @btime test_sum_turbo($D)
45.742 ms (0 allocations: 0 bytes)
9.999992255027126e7
julia> @btime test_sum_turbo($D_bit)
69.028 ms (0 allocations: 0 bytes)
99998730
julia> @btime test_sum_turbo($D_bool)
15.711 ms (0 allocations: 0 bytes)
99998730
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start with the supplied test_sum_turbo example and benchmark @turbo on BitArray, Array{Bool}, and floating-point arrays. Reproduce the slowdown and obtain the missing minimal working example for the check_args failure; the issue names no source file or test, so completion would require confirming the cause and an appropriate fix or limitation.
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
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100