Skip to content

Commit b1a2c49

Browse files
committed
always fall back to Krylov for CuSparseCSC
1 parent bd5f46a commit b1a2c49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/LinearSolveCUDAExt.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ function LinearSolve.defaultalg(A::CUDA.CUSPARSE.CuSparseMatrixCSR{Tv, Ti}, b,
3333
end
3434
end
3535

36+
function LinearSolve.defaultalg(A::CUDA.CUSPARSE.CuSparseMatrixCSC, b,
37+
assump::OperatorAssumptions{Bool})
38+
if LinearSolve.cudss_loaded(A)
39+
@warn("CUDSS.jl does not support CuSparseMatrixCSC for LU Factorizations, consider using CuSparseMatrixCSR instead. Falling back to Krylov", maxlog=1)
40+
else
41+
@warn("CuSparseMatrixCSC does not support LU Factorization falling back to Krylov. Consider using CUDSS.jl together with CuSparseMatrixCSR", maxlog=1)
42+
end
43+
LinearSolve.DefaultLinearSolver(LinearSolve.DefaultAlgorithmChoice.KrylovJL_GMRES)
44+
end
45+
3646
function LinearSolve.error_no_cudss_lu(A::CUDA.CUSPARSE.CuSparseMatrixCSR)
3747
if !LinearSolve.cudss_loaded(A)
3848
error("CUDSS.jl is required for LU Factorizations on CuSparseMatrixCSR. Please load this library.")

0 commit comments

Comments
 (0)