From a361f17b3c40b15f157cc3728b4841f6411848a2 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Tue, 31 Mar 2020 17:23:43 -0400 Subject: [PATCH] Bump deps to support some BitMatrix ops, and add tests. --- Manifest.toml | 8 ++++---- Project.toml | 6 +++--- src/determinestrategy.jl | 6 +++--- test/gemm.jl | 6 ++++++ test/gemv.jl | 9 ++++++++- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index a5b654f08..7e1d7e8f2 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -42,9 +42,9 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[SIMDPirates]] deps = ["VectorizationBase"] -git-tree-sha1 = "53c43af0172c24b0783bd93650bd8b78afb3e57b" +git-tree-sha1 = "adbd979a7bc7e83efabd60c34ff118788653955a" uuid = "21efa798-c60a-11e8-04d3-e1a92915a26a" -version = "0.7.5" +version = "0.7.6" [[SLEEFPirates]] deps = ["Libdl", "SIMDPirates", "VectorizationBase"] @@ -69,6 +69,6 @@ version = "0.1.0" [[VectorizationBase]] deps = ["CpuId", "LinearAlgebra"] -git-tree-sha1 = "2a83ab02d3fb6ad5de0c6d04103b0ca403d9a7d8" +git-tree-sha1 = "d0edd2aec08b18d39929f088c44873e2138e5be2" uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.9.5" +version = "0.9.6" diff --git a/Project.toml b/Project.toml index 9d8769fbc..dbbacbc97 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LoopVectorization" uuid = "bdcacae8-1622-11e9-2a5c-532679323890" authors = ["Chris Elrod "] -version = "0.6.25" +version = "0.6.26" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -13,10 +13,10 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" [compat] OffsetArrays = "1" -SIMDPirates = "0.7.5" +SIMDPirates = "0.7.6" SLEEFPirates = "0.4" UnPack = "0" -VectorizationBase = "0.9.5" +VectorizationBase = "0.9.6" julia = "1.1" [extras] diff --git a/src/determinestrategy.jl b/src/determinestrategy.jl index e12a53eaf..c99765d1e 100644 --- a/src/determinestrategy.jl +++ b/src/determinestrategy.jl @@ -272,13 +272,13 @@ function solve_tilesize(X, R, UL, TL) c = -RR*R[1]*X[3] discriminant = b^2 - 4a*c discriminant < 0 && return -1,-1,Inf - Ufloat = (sqrt(discriminant) - b) / (2a) - Tfloat = (RR - max(1.0,Ufloat)*R[2])/(max(1.0,Ufloat)*R[1]) + Ufloat = max(1.0, (sqrt(discriminant) - b) / (2a)) # must be at least 1 + Tfloat = (RR - Ufloat*R[2])/(Ufloat*R[1]) if !(isfinite(Tfloat) && isfinite(Ufloat)) return 4, 4, tile_cost(X, 4, 4, UL, TL) # return itertilesize(X, UL, TL) end - Ulow = max(1, floor(Int, Ufloat)) # must be at least 1 + Ulow = floor(Int, Ufloat) Tlow = max(1, floor(Int, Tfloat)) # must be at least 1 Uhigh = Ulow + 1 #ceil(Int, Ufloat) Thigh = Tlow + 1 #ceil(Int, Tfloat) diff --git a/test/gemm.jl b/test/gemm.jl index a353b8cd5..abd12c881 100644 --- a/test/gemm.jl +++ b/test/gemm.jl @@ -626,6 +626,12 @@ @test C ≈ C2 fill!(C, 9999.999); gemm_accurate!(C, At', Bt'); @test C ≈ C2 + Abit = A .> 0.5 + fill!(C, 9999.999); AmulBavx1!(C, Abit, B) + @test C ≈ Abit * B + Bbit = B .> 0.5 + fill!(C, 9999.999); AmulBavx1!(C, A, Bbit) + @test C ≈ A * Bbit end @time @testset "_avx $T dynamic gemm" begin AmulB_avx1!(C, A, B) diff --git a/test/gemv.jl b/test/gemv.jl index 5f769c840..ce080f98e 100644 --- a/test/gemv.jl +++ b/test/gemv.jl @@ -150,7 +150,7 @@ using Test for T ∈ (Float32, Float64, Int32, Int64) @show T, @__LINE__ TC = sizeof(T) == 4 ? Float32 : Float64 - R = T <: Integer ? (T(1):T(1000)) : T + R = T <: Integer ? (T(-1000):T(1000)) : T A = rand(R, M, K); x = rand(R, K); @@ -164,6 +164,13 @@ using Test mygemvavx_range!(y2, A, x) @test y1 ≈ y2 + Abit = A .> 0.5 + fill!(y2, -999.9); mygemv_avx!(y2, Abit, x) + @test y2 ≈ Abit * x + xbit = x .> 0.5 + fill!(y2, -999.9); mygemv_avx!(y2, A, xbit) + @test y2 ≈ A * xbit + B = rand(R, N, N); G1 = Matrix{TC}(undef, N, 1); G2 = similar(G1);