Skip to content

Commit 122bebe

Browse files
authored
Relax diagonal type in matrix-multiply (#1111)
1 parent 28e0482 commit 122bebe

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "StaticArrays"
22
uuid = "90137ffa-7385-5640-81b9-e52037218182"
3-
version = "1.5.10"
3+
version = "1.5.11"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/matrix_multiply_add.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const StaticMatMulLike{s1, s2, T} = Union{
2828
UnitUpperTriangular{T, <:StaticMatrix{s1, s2, T}},
2929
Adjoint{T, <:StaticMatrix{s1, s2, T}},
3030
Transpose{T, <:StaticMatrix{s1, s2, T}},
31-
SDiagonal{s1, T}}
31+
Diagonal{T, <:StaticVector{s1, T}}}
3232

3333
"""
3434
gen_by_access(expr_gen, a::Type{<:AbstractArray}, asym = :wrapped_a)
@@ -81,7 +81,7 @@ end
8181
function gen_by_access(expr_gen, a::Type{<:Adjoint{<:Any, <:StaticVecOrMat}}, asym = :wrapped_a)
8282
return expr_gen(:adjoint)
8383
end
84-
function gen_by_access(expr_gen, a::Type{<:SDiagonal}, asym = :wrapped_a)
84+
function gen_by_access(expr_gen, a::Type{<:Diagonal{<:Any, <:StaticVector}}, asym = :wrapped_a)
8585
return expr_gen(:diagonal)
8686
end
8787
"""
@@ -166,7 +166,7 @@ function gen_by_access(expr_gen, a::Type{<:Adjoint{<:Any, <:StaticMatrix}}, b::T
166166
end)
167167
end
168168
end
169-
function gen_by_access(expr_gen, a::Type{<:SDiagonal}, b::Type)
169+
function gen_by_access(expr_gen, a::Type{<:Diagonal{<:Any, <:StaticVector}}, b::Type)
170170
return quote
171171
return $(gen_by_access(b, :wrapped_b) do access_b
172172
expr_gen(:diagonal, access_b)

test/matrix_multiply_add.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function test_multiply_add(N1,N2,ArrayType=MArray)
122122
mul!(C,a,b',1.,1.)
123123
@test C 3a*b'
124124

125-
b = @benchmark mul!($C,$a,$b') samples=10 evals=10
125+
b = @benchmark mul!($C,$a,$(b')) samples=10 evals=10
126126
@test minimum(b).allocs <= expected_transpose_allocs
127127
# @test_noalloc mul!(C, a, b') # records 16 bytes
128128

0 commit comments

Comments
 (0)