Skip to content

Commit

Permalink
Move show test into allowscalar block
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Mar 7, 2025
1 parent ff7fbf8 commit 49edc86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/libraries/cusparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ blockdim = 5
@testset "array" begin
x = sprand(m,0.2)
d_x = CuSparseVector(x)
@test sprint(show, d_x) == replace(sprint(show, x), "SparseVector{Float64, Int64}"=>"CUDA.CUSPARSE.CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test length(d_x) == m
@test size(d_x) == (m,)
@test size(d_x,1) == m
@test size(d_x,2) == 1
@test ndims(d_x) == 1
dense_d_x = CuVector(x)
CUDA.@allowscalar begin
@test sprint(show, d_x) == replace(sprint(show, x), "SparseVector{Float64, Int64}"=>"CUDA.CUSPARSE.CuSparseVector{Float64, Int32}", "sparsevec(["=>"sparsevec(Int32[")
@test Array(d_x[:]) == x[:]
@test d_x[firstindex(d_x)] == x[firstindex(x)]
@test d_x[div(end, 2)] == x[div(end, 2)]
Expand Down

0 comments on commit 49edc86

Please sign in to comment.