Skip to content

Commit f2d31e8

Browse files
add CUDSS test
1 parent 0eda0bb commit f2d31e8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/gpu/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0"
33
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
4+
CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
45
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
56
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
67
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

test/gpu/cuda.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using LinearSolve, CUDA, LinearAlgebra, SparseArrays, StableRNGs
2+
using CUDA.CUSPARSE, CUDSS
23
using Test
34

45
CUDA.allowscalar(false)
@@ -91,3 +92,17 @@ prob2 = LinearProblem(transpose(A), b)
9192
sol = solve(prob2, alg; alias = LinearAliasSpecifier(alias_A = false))
9293
@test norm(transpose(A) * sol.u .- b) < 1e-5
9394
end
95+
96+
@testset "CUDSS" begin
97+
T = Float32
98+
n = 100
99+
A_cpu = sprand(T, n, n, 0.05) + I
100+
x_cpu = zeros(T, n)
101+
b_cpu = rand(T, n)
102+
103+
A_gpu_csr = CuSparseMatrixCSR(A_cpu)
104+
b_gpu = CuVector(b_cpu)
105+
106+
prob = LinearProblem(A_gpu_csr, b_gpu)
107+
sol = solve(prob)
108+
end

0 commit comments

Comments
 (0)