Skip to content

Commit

Permalink
Only test shifts if the CPU has the AVX2 instruction set.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 3, 2020
1 parent 47bd012 commit bb31225
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/miscellaneous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,19 @@
@test s s1
@test p p1
end
n = 511
for T [Int16, Int32, Int64]

out1 = rand(T(1):T(1_000), n);
out2 = copy(out1);
rshift_i!(out1)
rshift_i_avx!(out2)
@test out1 == out2
one_plus_i!(out1)
one_plus_i_avx!(out2)
@test out1 == out2
if LoopVectorization.VectorizationBase.AVX2
# Travis CI fails in this case. I do not have personal access to such a machine
# making it hard to debug.
n = 511
for T [Int16, Int32, Int64]
out1 = rand(T(1):T(1_000), n);
out2 = copy(out1);
rshift_i!(out1)
rshift_i_avx!(out2)
@test out1 == out2
one_plus_i!(out1)
one_plus_i_avx!(out2)
@test out1 == out2
end
end
end

0 comments on commit bb31225

Please sign in to comment.