Skip to content

Commit a114c4f

Browse files
Merge pull request #498 from SciML/myb/cuarray
Add default_factorize & `\` support for CuArray
2 parents 150f6f1 + 09cfb5b commit a114c4f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DiffEqBase"
22
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "6.30.4"
4+
version = "6.31.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/init.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ function __init__()
183183
_x = UpperTriangular(_qr.R) \ (_qr.Q' * reshape(b,length(b),1))
184184
x .= vec(_x)
185185
CuArrays.unsafe_free!(_x)
186+
return x
186187
end
188+
# make `\` work
189+
LinearAlgebra.ldiv!(F::CuArrays.CUSOLVER.CuQR, b::CuArrays.CuArray) = (x = similar(b); ldiv!(x, F, b); x)
190+
default_factorize(A::CuArrays.CuArray) = qr(A)
187191
function findall_events(affect!,affect_neg!,prev_sign::CuArrays.CuArray,next_sign::CuArrays.CuArray)
188192
hasaffect::Bool = affect! !== nothing
189193
hasaffectneg::Bool = affect_neg! !== nothing

src/linear_nonlinear.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
using LinearAlgebra, SparseArrays, SuiteSparse
2+
3+
# This is only used for oop stiff solvers
4+
default_factorize(A) = lu(A)
5+
26
mutable struct LinSolveFactorize{F}
37
factorization::F
48
A

0 commit comments

Comments
 (0)