Skip to content

Commit f6c26d8

Browse files
Check cudss_loaded() and error instead of falling back to Krylov
Updated defaultalg() to check if CUDSS is loaded and error immediately if not available, rather than removing the check entirely or falling back to Krylov (which also doesn't work on GPU). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a0668de commit f6c26d8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ext/LinearSolveCUDAExt.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ end
2222

2323
function LinearSolve.defaultalg(A::CUDA.CUSPARSE.CuSparseMatrixCSR{Tv, Ti}, b,
2424
assump::OperatorAssumptions{Bool}) where {Tv, Ti}
25-
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization)
25+
if LinearSolve.cudss_loaded(A)
26+
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization)
27+
else
28+
error("CUDSS.jl is required for LU Factorizations on CuSparseMatrixCSR. Please load this library.")
29+
end
2630
end
2731

2832
function LinearSolve.defaultalg(A::CUDA.CUSPARSE.CuSparseMatrixCSC{Tv, Ti}, b,
2933
assump::OperatorAssumptions{Bool}) where {Tv, Ti}
30-
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization)
34+
if LinearSolve.cudss_loaded(A)
35+
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.LUFactorization)
36+
else
37+
error("CUDSS.jl is required for LU Factorizations on CuSparseMatrixCSC. Please load this library.")
38+
end
3139
end
3240

3341
function LinearSolve.error_no_cudss_lu(A::CUDA.CUSPARSE.CuSparseMatrixCSR)

0 commit comments

Comments
 (0)