We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ae3e12 commit a266d9fCopy full SHA for a266d9f
1 file changed
test/gpu/cuda.jl
@@ -1,7 +1,20 @@
1
-using CUDA
+using CUDSS, CUDA, SparseArrays, LinearAlgebra
2
+using CUDA.CUSPARSE
3
using ArrayInterface
4
5
using Test
6
7
+A_cpu = Float32[1 0; 0 1]
8
+A_dense = CuMatrix(A_cpu)
9
+A_sparse = CuSparseMatrixCSR(sparse(A_cpu))
10
+
11
# Test whether lu_instance throws an error when invoked with an gpu array
-@test !isa(try ArrayInterface.lu_instance(CUDA.CuArray([1.f0 1.f0; 1.f0 1.f0])) catch ex ex end, Exception)
12
+lu_inst_dense = ArrayInterface.lu_instance(A_dense)
13
+lu_inst_sparse = ArrayInterface.lu_instance(A_sparse)
14
15
+# test that lu! is valid when using the inst as scratch
16
+lu_sparse = lu!(lu_inst_sparse, A_sparse)
17
18
+#test that the resulting lu works
19
+b = CuVector([1f0, 1f0])
20
+@test CUDA.@allowscalar lu_sparse \ b == [1, 1]
0 commit comments