Skip to content

Commit f87583e

Browse files
authored
Merge pull request #443 from SciML/ap/fixchol
Fix NormalCholesky on GPU
2 parents e60a10a + 300c4a9 commit f87583e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LinearSolve"
22
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
33
authors = ["SciML"]
4-
version = "2.20.1"
4+
version = "2.20.2"
55

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

src/factorization.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ default_alias_b(::NormalCholeskyFactorization, ::Any, ::Any) = true
896896
const PREALLOCATED_NORMALCHOLESKY = ArrayInterface.cholesky_instance(rand(1, 1), NoPivot())
897897

898898
function init_cacheval(alg::NormalCholeskyFactorization,
899-
A::Union{AbstractSparseArray,
899+
A::Union{AbstractSparseArray, GPUArraysCore.AbstractGPUArray,
900900
Symmetric{<:Number, <:AbstractSparseArray}}, b, u, Pl, Pr,
901901
maxiters::Int, abstol, reltol, verbose::Bool,
902902
assumptions::OperatorAssumptions)
@@ -921,7 +921,7 @@ function SciMLBase.solve!(cache::LinearCache, alg::NormalCholeskyFactorization;
921921
A = cache.A
922922
A = convert(AbstractMatrix, A)
923923
if cache.isfresh
924-
if A isa SparseMatrixCSC
924+
if A isa SparseMatrixCSC || A isa GPUArraysCore.AbstractGPUArray
925925
fact = cholesky(Symmetric((A)' * A, :L); check = false)
926926
else
927927
fact = cholesky(Symmetric((A)' * A, :L), alg.pivot; check = false)

test/gpu/cuda.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function test_interface(alg, prob1, prob2)
4444
return
4545
end
4646

47-
@testset "CudaOffloadFactorization" begin
48-
test_interface(CudaOffloadFactorization(), prob1, prob2)
47+
@testset "$alg" for alg in (CudaOffloadFactorization(), NormalCholeskyFactorization())
48+
test_interface(alg, prob1, prob2)
4949
end
5050

5151
@testset "Simple GMRES: restart = $restart" for restart in (true, false)

0 commit comments

Comments
 (0)