Hardware-accelerated linear KA index is wrong
- Dominant language
- Julia
- Stars
- 312
- Forks
- 50
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
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-repl
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
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.