Skip to content

Commit

Permalink
BLAS tests updated for new OpenBLAS where strided vectors change orde… (
Browse files Browse the repository at this point in the history
#300)

* BLAS tests updated for new OpenBLAS where strided vectors change order of operations

* give seed
  • Loading branch information
dlfivefifty authored Apr 18, 2024
1 parent c8b68a8 commit fcf5c6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ LinearAlgebra = "1"
Infinities = "0.1"
MacroTools = "0.5"
MatrixFactorizations = "1.0, 2.0"
Random = "1.0"
SparseArrays = "1"
StaticArrays = "1.0"
Test = "1"
Expand All @@ -36,9 +37,10 @@ julia = "1.9"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"

[targets]
test = ["Aqua", "Base64", "StaticArrays", "Tracker", "Test", "Infinities"]
test = ["Aqua", "Base64", "StaticArrays", "Tracker", "Test", "Infinities", "Random"]
7 changes: 5 additions & 2 deletions test/multests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64
using Test, LinearAlgebra, LazyArrays, StaticArrays, FillArrays, Base64, Random
import LazyArrays: MulAdd, MemoryLayout, DenseColumnMajor, DiagonalLayout, SymTridiagonalLayout, Add, AddArray,
MulStyle, MulAddStyle, Applied, ApplyStyle, Lmul, ApplyArrayBroadcastStyle, DefaultArrayApplyStyle,
Rmul, ApplyLayout, arguments, colsupport, rowsupport, lazymaterialize
import Base.Broadcast: materialize, materialize!, broadcasted
import MatrixFactorizations: QRCompactWYQLayout, AdjQRCompactWYQLayout

Random.seed!(123)

@testset "Matrix * Vector" begin
@testset "eltype" begin
@test @inferred(eltype(Applied(*, zeros(Int,2,2), zeros(Float64,2)))) == Float64
Expand Down Expand Up @@ -272,8 +274,9 @@ end
c .= @~ Ac*b
@test all(c .=== BLAS.gemv!('T', 1.0, A, b, 0.0, similar(c)))

= deepcopy(b)
b .= @~ Ac*b
@test all(c .=== b)
@test all(b .=== BLAS.gemv!('T', 1.0, A, Base.unalias(b̃,b̃), 0.0, b̃))

c .= @~ 2.0 * Ac*b
@test all(c .=== BLAS.gemv!('T', 2.0, A, b, 0.0, similar(c)))
Expand Down

0 comments on commit fcf5c6b

Please sign in to comment.