Initializing Sparse Matrices with CuArrays.jl

When you type a in the REPL, it attempts to show it. show tries to query the elements of the array by scalar indexing and you switched off scalar indexing (which is the right thing to do for detecting computational inefficiencies). Edit: It seems that scalar getindex is not defined for this array type. This is the cause of the error. I guess all I am saying is don’t show the matrix as a GPU matrix. If you want to display it, move it to the CPU first , or turn on scalar indexing. Otherwise, you can get on with your program normally, and this won’t affect the semantics of your code. Also note that this is only a problem in REPL. In normal Julia code, the output of each line is not displayed.

1 Like