Skip to content

Commit 1141414

Browse files
committed
Clarify that using different scopes is a data race
Even when using two atomic_ref objects with the same DefaultScope, it's possible to encounter a data race by overriding the scope parameter of individual operations. This is a general clean-up but was motivated by work-item scope atomics: any potentially concurrent use of work-item scope atomics and atomics with a different scope results in undefined behavior.
1 parent cb816e2 commit 1141414

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

adoc/chapters/architecture.adoc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,9 @@ programming and to provide a meaningful way to describe the behavior of
10961096
<<group,groups>> containing a single work-item.
10971097
{endnote}
10981098

1099+
Potentially concurrent conflicting actions with different memory scopes are
1100+
considered a data race, resulting in undefined behavior.
1101+
10991102
The memory scopes are listed above from narrowest
11001103
([code]#memory_scope::work_item#) to widest ([code]#memory_scope::system#).
11011104

@@ -1116,10 +1119,10 @@ supplied.
11161119
====
11171120
The addition of memory scopes to the {cpp} memory model modifies the definition
11181121
of some concepts from the {cpp} core language.
1119-
For example: data races, the synchronizes-with relationship and sequential
1120-
consistency must be defined in a way that accounts for atomic operations with
1121-
differing (but compatible) scopes, in a manner similar to the <<opencl20, OpenCL
1122-
2.0 specification>>.
1122+
For example: the synchronizes-with relationship and sequential consistency must
1123+
be defined in a way that accounts for atomic operations with differing (but
1124+
compatible) scopes, in a manner similar to the <<opencl20, OpenCL 2.0
1125+
specification>>.
11231126
Efforts to formalize the memory model of SYCL are ongoing, and a formal memory
11241127
model will be included in a future version of the SYCL specification.
11251128
====

0 commit comments

Comments
 (0)