From 59aed24edd7fc181b433557361dbb4a1fad247f8 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Fri, 8 Dec 2023 11:34:23 -0600 Subject: [PATCH] Fix the error with Hermtian matrices --- src/generic.jl | 1 + test/test_cudss.jl | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic.jl b/src/generic.jl index 280946b..d3591d3 100644 --- a/src/generic.jl +++ b/src/generic.jl @@ -12,6 +12,7 @@ function LinearAlgebra.ldlt(A::CuSparseMatrixCSR{T,Cint}) where T <: BlasFloat n = LinearAlgebra.checksquare(A) structure = T <: Real ? 'S' : 'H' solver = CudssSolver(A, structure, 'F') + (T <: Complex) && cudss_set(solver, "pivot_type", 'N') x = CudssMatrix(T, n) b = CudssMatrix(T, n) cudss("analysis", solver, x, b) diff --git a/test/test_cudss.jl b/test/test_cudss.jl index 6ff6089..1816418 100644 --- a/test/test_cudss.jl +++ b/test/test_cudss.jl @@ -230,7 +230,6 @@ function cudss_generic() B_gpu = CuMatrix(B_cpu) solver = ldlt(A_gpu) - (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)