Skip to content

Commit

Permalink
Aggressive constprop in matvecmul and matmatmul (#51961)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Dec 6, 2023
1 parent 6a1df3d commit cfcc043
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stdlib/LinearAlgebra/src/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ end
A
end

function gemv!(y::StridedVector{T}, tA::AbstractChar, A::StridedVecOrMat{T}, x::StridedVector{T},
Base.@constprop :aggressive function gemv!(y::StridedVector{T}, tA::AbstractChar,
A::StridedVecOrMat{T}, x::StridedVector{T},
α::Number=true, β::Number=false) where {T<:BlasFloat}
mA, nA = lapack_size(tA, A)
nA != length(x) &&
Expand Down Expand Up @@ -427,7 +428,7 @@ function gemv!(y::StridedVector{T}, tA::AbstractChar, A::StridedVecOrMat{T}, x::
end
end

function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMat{Complex{T}}, x::StridedVector{T},
Base.@constprop :aggressive function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMat{Complex{T}}, x::StridedVector{T},
α::Number = true, β::Number = false) where {T<:BlasReal}
mA, nA = lapack_size(tA, A)
nA != length(x) &&
Expand All @@ -449,8 +450,9 @@ function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMa
end
end

function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMat{T}, x::StridedVector{Complex{T}},
α::Number = true, β::Number = false) where {T<:BlasFloat}
Base.@constprop :aggressive function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar,
A::StridedVecOrMat{T}, x::StridedVector{Complex{T}},
α::Number = true, β::Number = false) where {T<:BlasReal}
mA, nA = lapack_size(tA, A)
nA != length(x) &&
throw(DimensionMismatch(lazy"second dimension of A, $nA, does not match length of x, $(length(x))"))
Expand Down

0 comments on commit cfcc043

Please sign in to comment.