Skip to content

Commit 1d403f4

Browse files
authored
Use Cartesian indices rather than linear (#48)
1 parent b111e63 commit 1d403f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ext/StridedGPUArraysExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ end
2424
function Base.fill!(A::StridedView{T, N, TA, F}, x) where {T, N, TA <: AbstractGPUArray{T}, F <: ALL_FS}
2525
isempty(A) && return A
2626
@kernel function fill_kernel!(a, val)
27-
idx = @index(Global, Linear)
27+
idx = @index(Global, Cartesian)
2828
@inbounds a[idx] = val
2929
end
3030
# ndims check for 0D support
3131
kernel = fill_kernel!(KernelAbstractions.get_backend(A))
3232
f_x = F <: Union{typeof(conj), typeof(adjoint)} ? conj(x) : x
33-
kernel(A, f_x; ndrange = length(A))
33+
kernel(A, f_x; ndrange = size(A))
3434
return A
3535
end
3636

0 commit comments

Comments
 (0)