-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Perhaps I'm misunderstanding something, but I would have expected @index(Global)
to always be a valid linear index into indices
between 1 and 1856400:
julia> using OpenCL, KernelAbstractions
julia> @kernel function foo(count, indices)
i = @index(Global)
k = Atomix.@atomic count[] += 1
indices[k] = i
end
julia> count, indices = OpenCL.zeros(Int32), CLArray{Int}(undef, 2000000);
julia> foo(OpenCLBackend())(count, indices; ndrange = (18564, 100))
julia> count
0-dimensional CLArray{Int32, 0, OpenCL.cl.UnifiedDeviceMemory}:
1856400
julia> maximum(indices[OpenCL.@allowscalar 1:count[]])
2046084
Metadata
Metadata
Assignees
Labels
No labels