Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Indexing CuArrays with Empty Ranges Errors #687

Closed
ChrisRackauckas opened this issue Apr 20, 2020 · 5 comments
Closed

Indexing CuArrays with Empty Ranges Errors #687

ChrisRackauckas opened this issue Apr 20, 2020 · 5 comments

Comments

@ChrisRackauckas
Copy link
Member

MWE:

using CuArrays
p = rand(10)
p[1:0] # works
cu(p)[1:0] # errors
DivideError: integer division error
div at int.jl:230 [inlined]
div at div.jl:215 [inlined]
div at div.jl:270 [inlined]
cld at div.jl:227 [inlined]
configurator at gpuarrays.jl:27 [inlined]
#cudacall#216 at execution.jl:259 [inlined]
cudacall at execution.jl:258 [inlined]
macro expansion at execution.jl:242 [inlined]
#call#204 at execution.jl:219 [inlined]
call at execution.jl:219 [inlined]
#_#223 at execution.jl:472 [inlined]
(::Core.var"#Any##kw")(::NamedTuple{(:config,),Tuple{CuArrays.var"#configurator#50"{Int64}}}, ::CUDAnative.HostKernel{GPUArrays.index_kernel,Tuple{CuArrays.CuKernelContext,CUDAnative.CuDeviceArray{Float32,1,CUDAnative.AS.Global},CUDAnative.CuDeviceArray{Float32,1,CUDAnative.AS.Global},Tuple{Int64},Tuple{UnitRange{Int64}}}}, ::CuArrays.CuKernelContext, ::CUDAnative.CuDeviceArray{Float32,1,CUDAnative.AS.Global}, ::CUDAnative.CuDeviceArray{Float32,1,CUDAnative.AS.Global}, ::Tuple{Int64}, ::Tuple{UnitRange{Int64}}) at execution.jl:472
macro expansion at execution.jl:158 [inlined]
gpu_call(::CuArrays.CuArrayBackend, ::Function, ::Tuple{CuArray{Float32,1,Nothing},CuArray{Float32,1,Nothing},Tuple{Int64},Tuple{UnitRange{Int64}}}, ::Int64; name::Nothing) at gpuarrays.jl:32
gpu_call at gpuarrays.jl:23 [inlined]
#gpu_call#1 at execution.jl:60 [inlined]
gpu_call at execution.jl:46 [inlined]
_unsafe_getindex! at indexing.jl:125 [inlined]
_unsafe_getindex at multidimensional.jl:741 [inlined]
_getindex at multidimensional.jl:727 [inlined]
getindex at abstractarray.jl:980 [inlined]
applychain(::Tuple{var"#13#14",FastDense{typeof(tanh),DiffEqFlux.var"#initial_params#75"{typeof(Flux.glorot_uniform),typeof(Flux.zeros),Int64,Int64}},FastDense{typeof(identity),DiffEqFlux.var"#initial_params#75"{typeof(Flux.glorot_uniform),typeof(Flux.zeros),Int64,Int64}}}, ::CuArray{Float32,1,Nothing}, ::CuArray{Float32,1,Nothing}) at fast_layers.jl:20
(::FastChain{Tuple{var"#13#14",FastDense{typeof(tanh),DiffEqFlux.var"#initial_params#75"{typeof(Flux.glorot_uniform),typeof(Flux.zeros),Int64,Int64}},FastDense{typeof(identity),DiffEqFlux.var"#initial_params#75"{typeof(Flux.glorot_uniform),typeof(Flux.zeros),Int64,Int64}}}})(::CuArray{Float32,1,Nothing}, ::CuArray{Float32,1,Nothing}) at fast_layers.jl:21
top-level scope at test.jl:57
@maleadt
Copy link
Member

maleadt commented Apr 20, 2020

Similar to JuliaGPU/GPUArrays.jl#264

@DrChainsaw
Copy link

Same issue even? The fix is not included in a release yet.

@ChrisRackauckas
Copy link
Member Author

Oh yes, looks like it's fixed on master.

@ChrisRackauckas
Copy link
Member Author

Could we get a GPUArrays release?

@maleadt
Copy link
Member

maleadt commented Apr 20, 2020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants