|
56 | 56 | end
|
57 | 57 |
|
58 | 58 | @testset "CuSparseMatrix(::Adjoint/::Transpose)" begin
|
59 |
| - A = sprand(5, 5, 0.2) |
60 |
| - for T in (CuSparseMatrixCSC, CuSparseMatrixCSR, CuSparseMatrixCOO), f in (transpose, adjoint) |
61 |
| - dA = T(f(A)) |
62 |
| - @test Array(dA) == f(A) |
| 59 | + for typ in (Float32, ComplexF32, Float64, ComplexF64) |
| 60 | + A = sprand(typ, 5, 5, 0.2) |
| 61 | + for T in (CuSparseMatrixCSC{typ}, CuSparseMatrixCSR{typ}, CuSparseMatrixCOO{typ}), f in (transpose, adjoint) |
| 62 | + dA = T(f(A)) |
| 63 | + @test Array(dA) == f(A) |
| 64 | + end |
63 | 65 | end
|
64 | 66 | end
|
65 | 67 |
|
@@ -123,19 +125,6 @@ for (n, bd, p) in [(100, 5, 0.02), (5, 1, 0.8), (4, 2, 0.5)]
|
123 | 125 | end
|
124 | 126 | end
|
125 | 127 |
|
126 |
| -for (n, p) in [(100, 0.02), (5, 0.8), (4, 0.5)] |
127 |
| - v"12.0" <= CUSPARSE.version() < v"12.1" && n == 4 && continue |
128 |
| - @testset "conversions between CuSparseMatrices (n, p) = ($n, $p)" begin |
129 |
| - A = sprand(n, n, p) |
130 |
| - for CuSparseMatrixType1 in (CuSparseMatrixCSC, CuSparseMatrixCSR), CuSparseMatrixType2 in (CuSparseMatrixCSC, CuSparseMatrixCSR), op in (transpose, adjoint) |
131 |
| - dA1 = CuSparseMatrixType1(A) |
132 |
| - @testset "conversion $op($CuSparseMatrixType1) --> $CuSparseMatrixType2" begin |
133 |
| - @test collect(CuSparseMatrixType2(op(dA1))) ≈ op(A) |
134 |
| - end |
135 |
| - end |
136 |
| - end |
137 |
| -end |
138 |
| - |
139 | 128 | @testset "sort CuSparseMatrix" begin
|
140 | 129 | # [5 7 0]
|
141 | 130 | # A = [8 0 6]
|
|
0 commit comments