@@ -50,7 +50,7 @@ synchronize(backend)
5050```
5151"""
5252macro kernel (expr)
53- __kernel (expr, #= generate_cpu=# true , #= force_inbounds=# false )
53+ return __kernel (expr, #= generate_cpu=# true , #= force_inbounds=# false )
5454end
5555
5656"""
@@ -68,7 +68,7 @@ This allows for two different configurations:
6868"""
6969macro kernel (ex... )
7070 if length (ex) == 1
71- __kernel (ex[1 ], true , false )
71+ return __kernel (ex[1 ], true , false )
7272 else
7373 generate_cpu = true
7474 force_inbounds = false
@@ -88,7 +88,7 @@ macro kernel(ex...)
8888 )
8989 end
9090 end
91- __kernel (ex[end ], generate_cpu, force_inbounds)
91+ return __kernel (ex[end ], generate_cpu, force_inbounds)
9292 end
9393end
9494
@@ -166,7 +166,7 @@ a tuple corresponding to kernel configuration. In order to get
166166the total size you can use `prod(@groupsize())`.
167167"""
168168macro groupsize ()
169- quote
169+ return quote
170170 $ groupsize ($ (esc (:__ctx__ )))
171171 end
172172end
@@ -178,7 +178,7 @@ Query the ndrange on the backend. This function returns
178178a tuple corresponding to kernel configuration.
179179"""
180180macro ndrange ()
181- quote
181+ return quote
182182 $ size ($ ndrange ($ (esc (:__ctx__ ))))
183183 end
184184end
@@ -192,7 +192,7 @@ macro localmem(T, dims)
192192 # Stay in sync with CUDAnative
193193 id = gensym (" static_shmem" )
194194
195- quote
195+ return quote
196196 $ SharedMemory ($ (esc (T)), Val ($ (esc (dims))), Val ($ (QuoteNode (id))))
197197 end
198198end
@@ -213,7 +213,7 @@ macro private(T, dims)
213213 if dims isa Integer
214214 dims = (dims,)
215215 end
216- quote
216+ return quote
217217 $ Scratchpad ($ (esc (:__ctx__ )), $ (esc (T)), Val ($ (esc (dims))))
218218 end
219219end
@@ -225,7 +225,7 @@ Creates a private local of `mem` per item in the workgroup. This can be safely u
225225across [`@synchronize`](@ref) statements.
226226"""
227227macro private (expr)
228- esc (expr)
228+ return esc (expr)
229229end
230230
231231"""
235235that span workitems, or are reused across `@synchronize` statements.
236236"""
237237macro uniform (value)
238- esc (value)
238+ return esc (value)
239239end
240240
241241"""
@@ -246,7 +246,7 @@ from each thread in the workgroup are visible in from all other threads in the
246246workgroup.
247247"""
248248macro synchronize ()
249- quote
249+ return quote
250250 $ __synchronize ()
251251 end
252252end
@@ -263,7 +263,7 @@ workgroup. `cond` is not allowed to have any visible sideffects.
263263 - `CPU`: This synchronization will always occur.
264264"""
265265macro synchronize (cond)
266- quote
266+ return quote
267267 $ (esc (cond)) && $ __synchronize ()
268268 end
269269end
288288```
289289"""
290290macro context ()
291- esc (:(__ctx__))
291+ return esc (:(__ctx__))
292292end
293293
294294"""
@@ -328,7 +328,7 @@ macro print(items...)
328328 end
329329 end
330330
331- quote
331+ return quote
332332 $ __print ($ (map (esc, args)... ))
333333 end
334334end
@@ -384,7 +384,7 @@ macro index(locale, args...)
384384 end
385385
386386 index_function = Symbol (:__index_ , locale, :_ , indexkind)
387- Expr (:call , GlobalRef (KernelAbstractions, index_function), esc (:__ctx__ ), map (esc, args)... )
387+ return Expr (:call , GlobalRef (KernelAbstractions, index_function), esc (:__ctx__ ), map (esc, args)... )
388388end
389389
390390# ##
@@ -590,7 +590,7 @@ struct Kernel{Backend, WorkgroupSize <: _Size, NDRange <: _Size, Fun}
590590end
591591
592592function Base. similar (kernel:: Kernel{D, WS, ND} , f:: F ) where {D, WS, ND, F}
593- Kernel {D, WS, ND, F} (kernel. backend, f)
593+ return Kernel {D, WS, ND, F} (kernel. backend, f)
594594end
595595
596596workgroupsize (:: Kernel{D, WorkgroupSize} ) where {D, WorkgroupSize} = WorkgroupSize
700700 push! (args, item)
701701 end
702702
703- quote
703+ return quote
704704 print ($ (args... ))
705705 end
706706end
0 commit comments