Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit eb2fb9c

Browse files
Upstream ldiv! overload
DiffEqBase.jl has been carrying an ldiv! overload to make it work for awhile (https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/src/init.jl#L148-L152), and I think it might be a good time to upstream it.
1 parent f637533 commit eb2fb9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/solver/linalg.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ LinearAlgebra.lmul!(adjA::Adjoint{T,<:CuQRPackedQ{T,S}}, B::CuVecOrMat{T}) where
5353
LinearAlgebra.lmul!(trA::Transpose{T,<:CuQRPackedQ{T,S}}, B::CuVecOrMat{T}) where {T<:Number, S<:CuMatrix} =
5454
ormqr!('L', 'T', parent(trA).factors, parent(trA).τ, B)
5555

56+
function LinearAlgebra.ldiv!(x::CuArrays.CuArray,_qr::CuArrays.CUSOLVER.CuQR,b::CuArrays.CuArray)
57+
_x = UpperTriangular(_qr.R) \ (_qr.Q' * reshape(b,length(b),1))
58+
x .= vec(_x)
59+
CuArrays.unsafe_free!(_x)
60+
end
61+
5662
function Base.getindex(A::CuQRPackedQ{T, S}, i::Integer, j::Integer) where {T, S}
5763
x = CuArrays.zeros(T, size(A, 2))
5864
x[j] = 1

0 commit comments

Comments
 (0)