Skip to content

Commit 3b4e280

Browse files
committed
gather throw error on cpu and gpu array inputs
1 parent da73f07 commit 3b4e280

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gather.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ function NNlib.gather!(dst::AnyCuArray, src::AnyCuArray, idx::AnyCuArray)
6363
kernel(args...; threads=threads, blocks=blocks)
6464
return dst
6565
end
66+
67+
function NNlib.gather(src::AnyCuArray, idx::AbstractArray)
68+
err_msg = "src and idx both must be on GPU, but received $(typeof(src)) and $(typeof(idx)), respectively."
69+
throw(ArgumentError(err_msg))
70+
end

0 commit comments

Comments
 (0)