Skip to content

Clarify atomics memory model - #1032

Merged
gmlueck merged 8 commits into
KhronosGroup:mainfrom
VerenaBeckham:verena/atomics_clarification
Aug 27, 2026
Merged

gmlueck merged 8 commits into
KhronosGroup:mainfrom
VerenaBeckham:verena/atomics_clarification

Conversation

@VerenaBeckham

Copy link
Copy Markdown
Contributor

Intended to replace #849. Based on text from OpenCL: https://gitlab.khronos.org/opencl/OpenCL-Docs/-/merge_requests/226.

Comment thread adoc/chapters/architecture.adoc
Comment thread adoc/chapters/architecture.adoc Outdated
2.0 specification>>.
For example: sequential consistency must be defined in a way that accounts for
atomic operations with differing (but compatible) scopes, in a manner similar to
the <<opencl20, OpenCL 2.0 specification>>.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there is a better way to refer to the OpenCL spec, which I believe is also a combined spec? Or should we just add a reference to the 3.1 spec?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a link to 3.3.7. Memory Consistency Model for OpenCL 2.x maybe the cleaner indeed .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm not sure what this sentence is trying to convey other than a TODO for the SYCL WG. Similarly, the following sentence is a promise of something we are still not doing. Is anyone opposed to just removing both lines?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this whole NOTE is a TODO for the WG. What do we need to do to address it? Since this PR is already addressing some memory model things, can it be expanded to address the remaining issues in this NOTE?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per WG discussion I have removed the rest of the note. I opened #1041 to track addressing the TODOs described in it.

Comment thread adoc/chapters/architecture.adoc Outdated
Comment thread adoc/chapters/architecture.adoc Outdated
Comment thread adoc/chapters/architecture.adoc Outdated
Comment on lines 1126 to 1130
[NOTE]
====
The addition of memory scopes to the {cpp} memory model modifies the definition
of some concepts from the {cpp} core language.
For example: data races, the synchronizes-with relationship and sequential
consistency must be defined in a way that accounts for atomic operations with
differing (but compatible) scopes, in a manner similar to the <<opencl20, OpenCL
2.0 specification>>.
Efforts to formalize the memory model of SYCL are ongoing, and a formal memory
model will be included in a future version of the SYCL specification.
====

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the note to issue.
Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #1041

Comment thread adoc/chapters/architecture.adoc
@TApplencourt

Copy link
Copy Markdown
Contributor

Merge as clarification of SYCL 2020 except

From SYCL {SYCL_VERSION} the memory scope of A and B may be different.

Which is a SYCL Next change.

@gmlueck
gmlueck merged commit 4dc10b0 into KhronosGroup:main Aug 27, 2026
2 checks passed
gmlueck added a commit that referenced this pull request Aug 31, 2026
Cherry pick #1032 from main
(cherry picked from commit 4dc10b0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants