Skip to content

Commit a361f17

Browse files
committed
Bump deps to support some BitMatrix ops, and add tests.
1 parent e390c17 commit a361f17

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

Manifest.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
4242

4343
[[SIMDPirates]]
4444
deps = ["VectorizationBase"]
45-
git-tree-sha1 = "53c43af0172c24b0783bd93650bd8b78afb3e57b"
45+
git-tree-sha1 = "adbd979a7bc7e83efabd60c34ff118788653955a"
4646
uuid = "21efa798-c60a-11e8-04d3-e1a92915a26a"
47-
version = "0.7.5"
47+
version = "0.7.6"
4848

4949
[[SLEEFPirates]]
5050
deps = ["Libdl", "SIMDPirates", "VectorizationBase"]
@@ -69,6 +69,6 @@ version = "0.1.0"
6969

7070
[[VectorizationBase]]
7171
deps = ["CpuId", "LinearAlgebra"]
72-
git-tree-sha1 = "2a83ab02d3fb6ad5de0c6d04103b0ca403d9a7d8"
72+
git-tree-sha1 = "d0edd2aec08b18d39929f088c44873e2138e5be2"
7373
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
74-
version = "0.9.5"
74+
version = "0.9.6"

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoopVectorization"
22
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
33
authors = ["Chris Elrod <[email protected]>"]
4-
version = "0.6.25"
4+
version = "0.6.26"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -13,10 +13,10 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
1313

1414
[compat]
1515
OffsetArrays = "1"
16-
SIMDPirates = "0.7.5"
16+
SIMDPirates = "0.7.6"
1717
SLEEFPirates = "0.4"
1818
UnPack = "0"
19-
VectorizationBase = "0.9.5"
19+
VectorizationBase = "0.9.6"
2020
julia = "1.1"
2121

2222
[extras]

src/determinestrategy.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ function solve_tilesize(X, R, UL, TL)
272272
c = -RR*R[1]*X[3]
273273
discriminant = b^2 - 4a*c
274274
discriminant < 0 && return -1,-1,Inf
275-
Ufloat = (sqrt(discriminant) - b) / (2a)
276-
Tfloat = (RR - max(1.0,Ufloat)*R[2])/(max(1.0,Ufloat)*R[1])
275+
Ufloat = max(1.0, (sqrt(discriminant) - b) / (2a)) # must be at least 1
276+
Tfloat = (RR - Ufloat*R[2])/(Ufloat*R[1])
277277
if !(isfinite(Tfloat) && isfinite(Ufloat))
278278
return 4, 4, tile_cost(X, 4, 4, UL, TL)
279279
# return itertilesize(X, UL, TL)
280280
end
281-
Ulow = max(1, floor(Int, Ufloat)) # must be at least 1
281+
Ulow = floor(Int, Ufloat)
282282
Tlow = max(1, floor(Int, Tfloat)) # must be at least 1
283283
Uhigh = Ulow + 1 #ceil(Int, Ufloat)
284284
Thigh = Tlow + 1 #ceil(Int, Tfloat)

test/gemm.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,12 @@
626626
@test C C2
627627
fill!(C, 9999.999); gemm_accurate!(C, At', Bt');
628628
@test C C2
629+
Abit = A .> 0.5
630+
fill!(C, 9999.999); AmulBavx1!(C, Abit, B)
631+
@test C Abit * B
632+
Bbit = B .> 0.5
633+
fill!(C, 9999.999); AmulBavx1!(C, A, Bbit)
634+
@test C A * Bbit
629635
end
630636
@time @testset "_avx $T dynamic gemm" begin
631637
AmulB_avx1!(C, A, B)

test/gemv.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ using Test
150150
for T (Float32, Float64, Int32, Int64)
151151
@show T, @__LINE__
152152
TC = sizeof(T) == 4 ? Float32 : Float64
153-
R = T <: Integer ? (T(1):T(1000)) : T
153+
R = T <: Integer ? (T(-1000):T(1000)) : T
154154

155155
A = rand(R, M, K);
156156
x = rand(R, K);
@@ -164,6 +164,13 @@ using Test
164164
mygemvavx_range!(y2, A, x)
165165
@test y1 y2
166166

167+
Abit = A .> 0.5
168+
fill!(y2, -999.9); mygemv_avx!(y2, Abit, x)
169+
@test y2 Abit * x
170+
xbit = x .> 0.5
171+
fill!(y2, -999.9); mygemv_avx!(y2, A, xbit)
172+
@test y2 A * xbit
173+
167174
B = rand(R, N, N);
168175
G1 = Matrix{TC}(undef, N, 1);
169176
G2 = similar(G1);

0 commit comments

Comments
 (0)