Skip to content

Commit

Permalink
add test for 3- and 5-arg mul! with 2x2 and 3x3 matrices product (#255)
Browse files Browse the repository at this point in the history
* 3- and 5-arg mul!

* 5-arg mul! after v1.3
  • Loading branch information
daviehh authored and christopher-dG committed Oct 8, 2020
1 parent 406d5b1 commit 345f935
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/linalg/LinAlgBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typename(::Type{T}) where {T} = string(isa(T,DataType) ? T.name : Base.unwrap_un
typename(::Type{M}) where {M<:Matrix} = "Matrix"
typename(::Type{V}) where {V<:Vector} = "Vector"

const UPLO = :U
const UPLO = :U

linalgmat(::Type{Matrix}, s) = randmat(s)
linalgmat(::Type{Diagonal}, s) = Diagonal(randvec(s))
Expand Down Expand Up @@ -115,6 +115,20 @@ for s in SIZES

end

# Issue #34013: mul! for 2x2 or 3x3 matrices
for s in (2, 3)
A = randmat(s)
B = randmat(s)
C = randmat(s)
g["3-arg mul!", s] = @benchmarkable LinearAlgebra.mul!($C, $A, $B)

if VERSION >= v"1.3"
(α, β) = rand(2)
g["5-arg mul!", s] = @benchmarkable LinearAlgebra.mul!($C, $A, $B, $α, $β)
end
end


for b in values(g)
b.params.time_tolerance = 0.45
b.params.samples = 100
Expand Down

0 comments on commit 345f935

Please sign in to comment.