-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error dealing with Bool
s
#60
Comments
Thanks for the issue. After commit 51a75c9: julia> using LoopVectorization
julia> function fooavx(x::Vector, y::Vector)
out = similar(x)
@avx for i ∈ eachindex(x)
out[i] = (x[i]*x[i] + y[i]*y[i]) < 1
end
out
end
fooavx (generic function with 1 method)
julia> function foo(x::Vector, y::Vector)
out = similar(x)
for i ∈ eachindex(x)
out[i] = (x[i]*x[i] + y[i]*y[i]) < 1
end
out
end
foo (generic function with 1 method)
julia> x, y = rand(10), rand(10); foo(x, y) == fooavx(x, y)
true I switched from using unsigned integers to represent bit-masks to using a specialized mask type. This also gives me the freedom to add specialized methods to it, so I can make julia> using SIMDPirates
julia> x = rand(8); y = rand(8);
julia> (x .> y)'
1×8 Adjoint{Bool,BitArray{1}}:
1 0 0 1 0 0 0 1
julia> vload(stridedpointer(x), (_MM{8}(0),)) > vload(stridedpointer(y), (_MM{8}(0),))
Mask{8,Bool}<1, 0, 0, 1, 0, 0, 0, 1> A version with this fix will be registered in a few minutes. I've added your example to the testsuite. The linked file has a few examples using conditional statements. Please file more issues if/when you run into more problems. |
I can't get the following code to work on the latest version of LoopVectorization
The text was updated successfully, but these errors were encountered: