Skip to content

Commit d223d48

Browse files
authored
Sparse conversion tests (#2698)
1 parent 073432d commit d223d48

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/libraries/cusparse/conversions.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ end
6565
end
6666
end
6767

68+
@testset "CuSparseMatrix(::Adjoint/::Transpose)" begin
69+
for typ in (Float32, ComplexF32, Float64, ComplexF64), (outer_T, T) in ((CuSparseMatrixCSC, CuSparseMatrixCSR{typ}), (CuSparseMatrixCSR, CuSparseMatrixCSC{typ}))
70+
A = sprand(typ, 5, 5, 0.2)
71+
d_A = outer_T(A)
72+
for f in (transpose, adjoint)
73+
dA = T(f(d_A))
74+
@test Array(dA) == f(A)
75+
end
76+
end
77+
end
78+
6879
@testset "CuSparseMatrix(::Diagonal)" begin
6980
X = Diagonal(rand(10))
7081
dX = cu(X)

0 commit comments

Comments
 (0)