File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1- using CUDA
1+ using CUDSS, CUDA, SparseArrays, LinearAlgebra
2+ using CUDA. CUSPARSE
23using ArrayInterface
34
45using Test
56
7+ A_cpu = Float32[1 0 ; 0 1 ]
8+ A_dense = CuMatrix (A_cpu)
9+ A_sparse = CuSparseMatrixCSR (sparse (A_cpu))
10+
611# Test whether lu_instance throws an error when invoked with an gpu array
7- @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 ]
You can’t perform that action at this time.
0 commit comments