@@ -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
@@ -206,7 +206,7 @@ a tuple corresponding to kernel configuration. In order to get
206206the total size you can use `prod(@groupsize())`.
207207"""
208208macro groupsize ()
209- quote
209+ return quote
210210 $ groupsize ($ (esc (:__ctx__ )))
211211 end
212212end
@@ -218,7 +218,7 @@ Query the ndrange on the backend. This function returns
218218a tuple corresponding to kernel configuration.
219219"""
220220macro ndrange ()
221- quote
221+ return quote
222222 $ size ($ ndrange ($ (esc (:__ctx__ ))))
223223 end
224224end
@@ -232,7 +232,7 @@ macro localmem(T, dims)
232232 # Stay in sync with CUDAnative
233233 id = gensym (" static_shmem" )
234234
235- quote
235+ return quote
236236 $ SharedMemory ($ (esc (T)), Val ($ (esc (dims))), Val ($ (QuoteNode (id))))
237237 end
238238end
@@ -253,7 +253,7 @@ macro private(T, dims)
253253 if dims isa Integer
254254 dims = (dims,)
255255 end
256- quote
256+ return quote
257257 $ Scratchpad ($ (esc (:__ctx__ )), $ (esc (T)), Val ($ (esc (dims))))
258258 end
259259end
@@ -265,7 +265,7 @@ Creates a private local of `mem` per item in the workgroup. This can be safely u
265265across [`@synchronize`](@ref) statements.
266266"""
267267macro private (expr)
268- esc (expr)
268+ return esc (expr)
269269end
270270
271271"""
275275that span workitems, or are reused across `@synchronize` statements.
276276"""
277277macro uniform (value)
278- esc (value)
278+ return esc (value)
279279end
280280
281281"""
@@ -286,7 +286,7 @@ from each thread in the workgroup are visible in from all other threads in the
286286workgroup.
287287"""
288288macro synchronize ()
289- quote
289+ return quote
290290 $ __synchronize ()
291291 end
292292end
@@ -303,7 +303,7 @@ workgroup. `cond` is not allowed to have any visible sideffects.
303303 - `CPU`: This synchronization will always occur.
304304"""
305305macro synchronize (cond)
306- quote
306+ return quote
307307 $ (esc (cond)) && $ __synchronize ()
308308 end
309309end
328328```
329329"""
330330macro context ()
331- esc (:(__ctx__))
331+ return esc (:(__ctx__))
332332end
333333
334334"""
@@ -368,7 +368,7 @@ macro print(items...)
368368 end
369369 end
370370
371- quote
371+ return quote
372372 $ __print ($ (map (esc, args)... ))
373373 end
374374end
@@ -424,7 +424,7 @@ macro index(locale, args...)
424424 end
425425
426426 index_function = Symbol (:__index_ , locale, :_ , indexkind)
427- Expr (:call , GlobalRef (KernelAbstractions, index_function), esc (:__ctx__ ), map (esc, args)... )
427+ return Expr (:call , GlobalRef (KernelAbstractions, index_function), esc (:__ctx__ ), map (esc, args)... )
428428end
429429
430430# ##
@@ -662,7 +662,7 @@ struct Kernel{Backend, WorkgroupSize <: _Size, NDRange <: _Size, Fun}
662662end
663663
664664function Base. similar (kernel:: Kernel{D, WS, ND} , f:: F ) where {D, WS, ND, F}
665- Kernel {D, WS, ND, F} (kernel. backend, f)
665+ return Kernel {D, WS, ND, F} (kernel. backend, f)
666666end
667667
668668workgroupsize (:: Kernel{D, WorkgroupSize} ) where {D, WorkgroupSize} = WorkgroupSize
772772 push! (args, item)
773773 end
774774
775- quote
775+ return quote
776776 print ($ (args... ))
777777 end
778778end
0 commit comments