Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing sparse arrays goes wrong #146

Closed
maleadt opened this issue Feb 22, 2019 · 2 comments
Closed

Showing sparse arrays goes wrong #146

maleadt opened this issue Feb 22, 2019 · 2 comments
Labels
bug Something isn't working cuda array Stuff about CuArray.

Comments

@maleadt
Copy link
Member

maleadt commented Feb 22, 2019

julia> using CuArrays

julia> using CuArrays.CURAND

julia> using SparseArrays

julia> CuArrays.CUSPARSE.CuSparseMatrixCSR(sprand(10,10,0.1))
[ Info: Building the CUDAnative run-time library for your sm_35 device, this might take a while...
10×10 CuArrays.CUSPARSE.CuSparseMatrixCSR{Float64}:
Error showing value of type CuArrays.CUSPARSE.CuSparseMatrixCSR{Float64}:
ERROR: getindex not defined for CuArrays.CUSPARSE.CuSparseMatrixCSR{Float64}

From https://discourse.julialang.org/t/initializing-sparse-matrices-with-cuarrays-jl/21062

@carstenbauer
Copy link
Member

carstenbauer commented Jul 26, 2019

ERROR: getindex not defined for CuArrays.CUSPARSE.CuSparseMatrixCSR{Float64}

Doesn't this also make the arrays basically unusable (besides the displaying issue)? After all getindex is one of the mandatory functions of the AbstractArray interface.

@maleadt
Copy link
Member Author

maleadt commented Jul 26, 2019

No, you never actually want to index scalar elements from the CPU side. We call into vectorized CUSPARSE methods using multiple dispatch, which doesn't rely on cusparse, or (in the case of other CUDA array types) convert them to a device-side object such as CuDeviceArray that does implement (device-side!) getindex.

@maleadt maleadt transferred this issue from JuliaGPU/CuArrays.jl May 27, 2020
@maleadt maleadt added bug Something isn't working cuda array Stuff about CuArray. labels May 27, 2020
@maleadt maleadt closed this as completed Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuda array Stuff about CuArray.
Projects
None yet
Development

No branches or pull requests

2 participants