JuliaGPU / JuliaGPU/OpenCL.jl

Hardware-accelerated linear KA index is wrong

Open
#346 1 comment 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.