Skip to content

Commit d3d0fa9

Browse files
Merge pull request #472 from JuliaArrays/os/bump-cudss
bump CUDSS version and add CUDSS tests
2 parents 994bc7b + a266d9f commit d3d0fa9

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Adapt = "4"
3939
BandedMatrices = "1"
4040
BlockBandedMatrices = "0.13"
4141
CUDA = "5"
42-
CUDSS = "0.5, 0.6"
42+
CUDSS = "0.6.1"
4343
ChainRules = "1"
4444
ChainRulesCore = "1"
4545
ChainRulesTestUtils = "1"

test/gpu/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[deps]
22
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3-
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
3+
CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
4+
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"

test/gpu/cuda.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
using CUDA
1+
using CUDSS, CUDA, SparseArrays, LinearAlgebra
2+
using CUDA.CUSPARSE
23
using ArrayInterface
34

45
using 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]

0 commit comments

Comments
 (0)