Skip to content

Commit c19b9f0

Browse files
dkarraschjishnubViralBShah
authored
[release] Backports to v1.10 (#465)
Aggressive constprop in sparse * dense (#460) Co-authored-by: Jishnu Bhattacharya <[email protected]> Co-authored-by: Viral B. Shah <[email protected]>
1 parent 19e5a97 commit c19b9f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ LinearAlgebra.generic_matmatmul!(C::StridedMatrix, tA, tB, A::SparseMatrixCSCUni
3535
LinearAlgebra.generic_matvecmul!(C::StridedVecOrMat, tA, A::SparseMatrixCSCUnion, B::DenseInputVector, _add::MulAddMul) =
3636
spdensemul!(C, tA, 'N', A, B, _add)
3737

38-
function spdensemul!(C, tA, tB, A, B, _add)
38+
Base.@constprop :aggressive function spdensemul!(C, tA, tB, A, B, _add)
3939
if tA == 'N'
4040
_spmatmul!(C, A, LinearAlgebra.wrap(B, tB), _add.alpha, _add.beta)
4141
elseif tA == 'T'
@@ -97,7 +97,7 @@ end
9797
*(A::AdjOrTrans{<:Any,<:AbstractSparseMatrixCSC}, B::DenseTriangular) =
9898
(T = promote_op(matprod, eltype(A), eltype(B)); mul!(similar(B, T, (size(A, 1), size(B, 2))), A, B))
9999

100-
function LinearAlgebra.generic_matmatmul!(C::StridedMatrix, tA, tB, A::DenseMatrixUnion, B::AbstractSparseMatrixCSC, _add::MulAddMul)
100+
Base.@constprop :aggressive function LinearAlgebra.generic_matmatmul!(C::StridedMatrix, tA, tB, A::DenseMatrixUnion, B::AbstractSparseMatrixCSC, _add::MulAddMul)
101101
transA = tA == 'N' ? identity : tA == 'T' ? transpose : adjoint
102102
if tB == 'N'
103103
_spmul!(C, transA(A), B, _add.alpha, _add.beta)

src/sparsevector.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ function (*)(A::_StridedOrTriangularMatrix{Ta}, x::AbstractSparseVector{Tx}) whe
17981798
mul!(y, A, x)
17991799
end
18001800

1801-
function LinearAlgebra.generic_matvecmul!(y::AbstractVector, tA, A::StridedMatrix, x::AbstractSparseVector,
1801+
Base.@constprop :aggressive function LinearAlgebra.generic_matvecmul!(y::AbstractVector, tA, A::StridedMatrix, x::AbstractSparseVector,
18021802
_add::MulAddMul = MulAddMul())
18031803
if tA == 'N'
18041804
_spmul!(y, A, x, _add.alpha, _add.beta)
@@ -1918,7 +1918,7 @@ function densemv(A::AbstractSparseMatrixCSC, x::AbstractSparseVector; trans::Abs
19181918
end
19191919

19201920
# * and mul!
1921-
function LinearAlgebra.generic_matvecmul!(y::AbstractVector, tA, A::AbstractSparseMatrixCSC, x::AbstractSparseVector,
1921+
Base.@constprop :aggressive function LinearAlgebra.generic_matvecmul!(y::AbstractVector, tA, A::AbstractSparseMatrixCSC, x::AbstractSparseVector,
19221922
_add::MulAddMul = MulAddMul())
19231923
if tA == 'N'
19241924
_spmul!(y, A, x, _add.alpha, _add.beta)

0 commit comments

Comments
 (0)