Skip to content

Commit

Permalink
add tests for sparse-transpose(dense)
Browse files Browse the repository at this point in the history
  • Loading branch information
irhum committed May 27, 2020
1 parent 60e5158 commit 54c012a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cusparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,7 @@ end
A = sparse(rand(elty,m,k))
B = rand(elty,k,n)
C = rand(elty,m,n)
Bᵀ = collect(transpose(B))
alpha = rand(elty)
beta = rand(elty)
@testset "csr" begin
Expand All @@ -1744,6 +1745,12 @@ end
h_C = collect(d_C)
D = A * B
@test D h_C
d_Bᵀ = CuArray(Bᵀ)
d_C = CuArray(C)
mul!(d_C, d_A, transpose(d_Bᵀ))
h_C = collect(d_C)
D = A * transpose(Bᵀ)
@test D h_C
end
@testset "csc" begin
d_B = CuArray(B)
Expand All @@ -1758,6 +1765,9 @@ end
h_C = collect(d_C)
D = A * B
@test D h_C
d_Bᵀ = CuArray(Bᵀ)
d_C = CuArray(C)
@test_throws CUSPARSEError mul!(d_C, d_A, transpose(d_Bᵀ))
end
end
end
Expand Down

0 comments on commit 54c012a

Please sign in to comment.