Skip to content

Commit 0cc2c0d

Browse files
committed
Don't use @index(Global)
1 parent 6873c8c commit 0cc2c0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/histogram.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ end
1414

1515
# This a 1D histogram kernel where the histogramming happens on shmem
1616
@kernel unsafe_indices=true function histogram_kernel!(histogram_output, input)
17-
tid = @index(Global, Linear)
17+
gid = @index(Group, Linear)
1818
lid = @index(Local, Linear)
1919

2020
@uniform gs = prod(@groupsize())
21+
tid = (gid - 1) * gs + lid
2122
@uniform N = length(histogram_output)
2223

2324
shared_histogram = @localmem eltype(input) (gs)

0 commit comments

Comments
 (0)