Closed dlfivefifty closed 6 years ago
ah, that might hit a slow path...Did you check with GPUArrays.allowslow(false)
?
julia> A[:] = 1
ERROR: setindex! is disabled
Stacktrace:
[1] assertslow(::String) at /Users/sheehanolver/.julia/v0.6/GPUArrays/src/indexing.jl:6
[2] setindex! at /Users/sheehanolver/.julia/v0.6/GPUArrays/src/indexing.jl:30 [inlined]
[3] setindex!(::CLArrays.CLArray{Float32,1}, ::Int64, ::Int64) at /Users/sheehanolver/.julia/v0.6/GPUArrays/src/indexing.jl:34
[4] macro expansion at ./multidimensional.jl:558 [inlined]
[5] macro expansion at ./cartesian.jl:64 [inlined]
[6] macro expansion at ./multidimensional.jl:556 [inlined]
[7] _unsafe_setindex!(::IndexLinear, ::CLArrays.CLArray{Float32,1}, ::Int64, ::Base.Slice{Base.OneTo{Int64}}) at ./multidimensional.jl:549
[8] macro expansion at ./multidimensional.jl:541 [inlined]
[9] _setindex! at ./multidimensional.jl:537 [inlined]
[10] setindex!(::CLArrays.CLArray{Float32,1}, ::Int64, ::Colon) at ./abstractarray.jl:968
I'm trying to set entries of a CLArray to a constant but it's much slower than just creating a new
Array
and converting it: