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
using CUDA
CUDA.allowscalar(false)
A =cu(sprand(100,100,0.1))
A .+2
Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
This is typically caused by calling an iterating implementation of a method.
Such implementations *do not* execute on the GPU, but very slowly on the CPU,
and therefore are only permitted from the REPL for prototyping purposes.
If you did intend to index this array, annotate the caller with @allowscalar.
error(s::String) at error.jl:33assertscalar(op::String) at indexing.jl:53getindex(xs::CuArray{Int32, 1, CUDA.Mem.DeviceBuffer}, I::Int64) at indexing.jl:86getindex(A::CUDA.CUSPARSE.CuSparseMatrixCSC{Float32, Int32}, i0::Int64, i1::Int64) at array.jl:292
_getindex at abstractarray.jl:1262 [inlined]
getindex at abstractarray.jl:1218 [inlined]
_broadcast_getindex at broadcast.jl:636 [inlined]
_getindex at broadcast.jl:666 [inlined]
_broadcast_getindex at broadcast.jl:642 [inlined]
getindex at broadcast.jl:597 [inlined]
macro expansion at broadcast.jl:961 [inlined]
macro expansion at simdloop.jl:77 [inlined]
copyto! at broadcast.jl:960 [inlined]
copyto! at broadcast.jl:913 [inlined]
copy at broadcast.jl:885 [inlined]
materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(+), Tuple{CUDA.CUSPARSE.CuSparseMatrixCSC{Float32, Int32}, Int64}}) at broadcast.jl:860
top-level scope at test.jl:130
eval at boot.jl:373 [inlined]
The text was updated successfully, but these errors were encountered:
using CUDA
CUDA.allowscalar(false)
A =cu(sprand(100,100,0.1))
fill!(A,true)
setindex! not defined for CUDA.CUSPARSE.CuSparseMatrixCSC{Float32, Int32}
error(::String, ::Type) at error.jl:42error_if_canonical_setindex(::IndexCartesian, ::CUDA.CUSPARSE.CuSparseMatrixCSC{Float32, Int32}, ::Int64, ::Int64) at abstractarray.jl:1325
setindex! at abstractarray.jl:1314 [inlined]
_setindex! at abstractarray.jl:1345 [inlined]
setindex! at abstractarray.jl:1315 [inlined]
fill!(A::CUDA.CUSPARSE.CuSparseMatrixCSC{Float32, Int32}, x::Bool) at multidimensional.jl:1064
top-level scope at test.jl:120
eval at boot.jl:373 [inlined]
The text was updated successfully, but these errors were encountered: