JuliaSIMD / JuliaSIMD/LoopVectorization.jl

BitArray support?

Open
#386 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
789
Forks
73
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.