You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}
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.
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.
From https://discourse.julialang.org/t/initializing-sparse-matrices-with-cuarrays-jl/21062
The text was updated successfully, but these errors were encountered: