Skip to content

Commit

Permalink
Fix the big bug between the chair and the screen
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Dec 8, 2023
1 parent 0ae52e5 commit 3d457e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end

function LinearAlgebra.cholesky(A::CuSparseMatrixCSR{T,Cint}) where T <: BlasFloat
n = LinearAlgebra.checksquare(A)
structure = T <: Real ? "SDP" : "HDP"
structure = T <: Real ? "SPD" : "HPD"
solver = CudssSolver(A, structure, 'F')
x = CudssMatrix(T, n)
b = CudssMatrix(T, n)
Expand All @@ -46,11 +46,11 @@ end
for type in (:CuVector, :CuMatrix)
@eval begin
function LinearAlgebra.ldiv!(solver::CudssSolver, b::$type{T}) where T <: BlasFloat
cudss("factorization", solver, b, b)
cudss("solve", solver, b, b)
end

function LinearAlgebra.ldiv!(x::$type{T}, solver::CudssSolver, b::$type{T}) where T <: BlasFloat
cudss("factorization", solver, x, b)
cudss("solve", solver, x, b)
end
end
end
2 changes: 1 addition & 1 deletion test/test_cudss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function cudss_generic()
B_gpu = CuMatrix(B_cpu)

solver = ldlt(A_gpu)
(structure == 'H') && cudss_set(solver, "pivot_type", 'N')
(T <: Complex) && cudss_set(solver, "pivot_type", 'N')
ldiv!(X_gpu, solver, B_gpu)
R_gpu = B_gpu - A_gpu * X_gpu
@test norm(R_gpu) eps(R)
Expand Down

0 comments on commit 3d457e6

Please sign in to comment.