Skip to content

Commit f0a545c

Browse files
committed
All backends are synchronizing
1 parent 282fa13 commit f0a545c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/intrinsics.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,21 @@ localmemory(::Type{T}, dims) where {T} = localmemory(T, Val(dims))
192192
shfl_down(val::T, offset::Integer) where T
193193
194194
Read `val` from a lane with higher id given by `offset`.
195-
When writing kernels using this function, it should be
196-
assumed that it is not synchronized.
195+
196+
!!! note
197+
`shfl_down` must be encountered by all workitems of a sub-group executing the kernel or by none at all.
197198
198199
!!! note
199200
Backend implementations **must** implement:
200201
```
201202
@device_override shfl_down(val::T, offset::Integer) where T
202203
```
203204
As well as the on-device functionality.
205+
206+
This implementation **must** be synchronizing.
207+
That is, kernels using this function can safely assume that
208+
they do **not** need a `sub_group_barrier` before calling
209+
this function.
204210
"""
205211
function shfl_down end
206212

0 commit comments

Comments
 (0)