Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Adapt = "4"
BandedMatrices = "1"
BlockBandedMatrices = "0.13"
CUDA = "5"
CUDSS = "0.5, 0.6"
CUDSS = "0.6.1"
ChainRules = "1"
ChainRulesCore = "1"
ChainRulesTestUtils = "1"
Expand Down
3 changes: 2 additions & 1 deletion test/gpu/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
17 changes: 15 additions & 2 deletions test/gpu/cuda.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
using CUDA
using CUDSS, CUDA, SparseArrays, LinearAlgebra
using CUDA.CUSPARSE
using ArrayInterface

using Test

A_cpu = Float32[1 0; 0 1]
A_dense = CuMatrix(A_cpu)
A_sparse = CuSparseMatrixCSR(sparse(A_cpu))

# 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)
lu_inst_dense = ArrayInterface.lu_instance(A_dense)
lu_inst_sparse = ArrayInterface.lu_instance(A_sparse)

# test that lu! is valid when using the inst as scratch
lu_sparse = lu!(lu_inst_sparse, A_sparse)

#test that the resulting lu works
b = CuVector([1f0, 1f0])
@test CUDA.@allowscalar lu_sparse \ b == [1, 1]
Loading