We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 035b00b commit f08a059Copy full SHA for f08a059
1 file changed
lib/cusparse/test/construction.jl
@@ -88,4 +88,28 @@ if capability(device()) >= v"5.3"
88
end
89
90
91
+
92
+@testset "similar for COO and BSR with custom types/dims" begin
93
+ row = CuVector{Cint}([1, 2, 3])
94
+ col = CuVector{Cint}([1, 2, 3])
95
+ val = CuVector{Float32}([1.0, 2.0, 3.0])
96
+ coo_mat = CuSparseMatrixCOO(row, col, val, (3, 3))
97
98
+ coo_sim = similar(coo_mat, Float64, (3, 3))
99
+ @test eltype(coo_sim) == Float64
100
+ @test size(coo_sim) == (3, 3)
101
+ @test typeof(coo_sim) <: CuSparseMatrixCOO
102
103
+ rowPtr = CuVector{Cint}([1, 2, 3])
104
+ colVal = CuVector{Cint}([1, 2])
105
+ valBSR = CuVector{Float32}([1.0, 2.0, 3.0, 4.0])
106
+ bsr_mat = CuSparseMatrixBSR(rowPtr, colVal, valBSR, 2, 'R', 1, (4, 4))
107
108
+ bsr_sim = similar(bsr_mat, Float64, (4, 4))
109
+ @test eltype(bsr_sim) == Float64
110
+ @test size(bsr_sim) == (4, 4)
111
+ @test typeof(bsr_sim) <: CuSparseMatrixBSR
112
+ @test bsr_sim.blockDim == bsr_mat.blockDim
113
+end
114
115
0 commit comments