Skip to content

Commit 798e5a5

Browse files
committed
add comment
1 parent 40fec7c commit 798e5a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/base.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ function _sub2ind(inds, L, ind, i::IT, I::IT...) where IT
9393
_sub2ind(Base.tail(inds), L * r1, ind + (i - IT(1)) * L, I...)
9494
end
9595

96+
# This is pretty ugly, but I feel bad to add those to device arrays, since
97+
# we're never bound checking... So getindex(a::GPUVector, 10, 10) would silently go unnoticed
98+
# we need this here for easier implementation of repmat
9699
@inline Base.@propagate_inbounds getidx_2d1d(x::AbstractVector, i, j) = x[i]
97100
@inline Base.@propagate_inbounds getidx_2d1d(x::AbstractMatrix, i, j) = x[i, j]
98101

0 commit comments

Comments
 (0)