Skip to content

Commit ab3b3d5

Browse files
committed
Tests for some helper functions
1 parent 93871d8 commit ab3b3d5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/libraries/cusolver/dense.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ k = 1
3737
dR = dB - dA * dX
3838
@test norm(dR) <= tol
3939
end
40+
@testset "IRSParameters" begin
41+
params = CUSOLVER.CuSolverIRSParameters()
42+
max_iter = 10
43+
CUSOLVER.cusolverDnIRSParamsSetMaxIters(params, max_iter)
44+
@test CUSOLVER.get_info(params, :maxiters) == max_iter
45+
@test_throws ErrorException("The information fake is incorrect.") CUSOLVER.get_info(params, :fake)
46+
A = rand(elty, n, n)
47+
X = zeros(elty, n, p)
48+
B = rand(elty, n, p)
49+
dA = CuArray(A)
50+
dX = CuArray(X)
51+
dB = CuArray(B)
52+
dX, info = CUSOLVER.gesv!(dX, dA, dB; maxiters=max_iter)
53+
@test CUSOLVER.get_info(info, :maxiters) == max_iter
54+
@test CUSOLVER.get_info(info, :niters) <= max_iter
55+
@test CUSOLVER.get_info(info, :outer_niters) <= max_iter
56+
@test_throws ErrorException("The information fake is incorrect.") CUSOLVER.get_info(info, :fake)
57+
end
4058
end
4159

4260
@testset "gels!" begin

0 commit comments

Comments
 (0)