Skip to content

Commit 1f0ad39

Browse files
committed
fix
1 parent e58131a commit 1f0ad39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gather.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ function NNlib.gather!(dst::AnyCuArray, src::AnyCuArray, idx::AnyCuArray)
6666

6767
# check bounds
6868
chk = checkbounds_src(src, dims, eltype(idx))
69-
isempty(src) && return dst
7069
in_bnd = map(chk, collect(idx))
7170
if !all(in_bnd)
7271
j = findfirst(i -> !i, in_bnd)
7372
k = CUDA.@allowscalar idx[j]
7473
throw(BoundsError(src, k))
7574
end
7675

76+
# empty array input
77+
isempty(src) && return dst
78+
7779
# cuda kernel
7880
args = dst, src, idx, max_idx, max_dims_idx, dims_size
7981
kernel = @cuda launch=false gather_kernel!(args...)

0 commit comments

Comments
 (0)