Skip to content

Commit 2f85926

Browse files
committed
Gensym the local memory id.
1 parent ea56e22 commit 2f85926

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/device/memory.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ export @LocalMemory
55

66
## thread-local array
77

8-
const shmem_counter = Ref{Int}(0)
9-
108
"""
119
Creates a local static memory shared inside one block.
1210
Equivalent to `__local` of OpenCL or `__shared__ (<variable>)` of CUDA.
1311
"""
1412
macro LocalMemory(ctx, T, N)
15-
id = (shmem_counter[] += 1)
13+
id = gensym("local_memory")
1614
quote
17-
LocalMemory($(esc(ctx)), $(esc(T)), Val($(esc(N))), Val($id))
15+
LocalMemory($(esc(ctx)), $(esc(T)), Val($(esc(N))), Val($(QuoteNode(id))))
1816
end
1917
end
2018

0 commit comments

Comments
 (0)