Skip to content

Commit cb816e2

Browse files
committed
Clarify behavior of atomic_ref DefaultScope
An implementation of atomic_ref<T> that was not lock-free needs to know which work-items may access the lock in order to decide where to allocate the lock. This additionally serves as a clarification of the behavior of work-item scope; using an atomic_ref with work-item scope at the same time as an atomic_ref with broader scope is invalid.
1 parent 9576b31 commit cb816e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

adoc/chapters/programming_interface.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20340,6 +20340,10 @@ scope for the atomic operations.
2034020340
Most member functions also provide an optional parameter that allows the
2034120341
application to override this default.
2034220342

20343+
All accesses to an object referenced by an [code]#sycl::atomic_ref# must
20344+
exclusively occur through instances of an [code]#sycl::atomic_ref# with the same
20345+
[code]#DefaultScope#.
20346+
2034320347
The [code]#sycl::atomic_ref# class also has a template parameter
2034420348
[code]#AddressSpace#, which allows the application to make an assertion about
2034520349
the address space of the object of type [code]#T# that it references.

0 commit comments

Comments
 (0)