Skip to content

[SYCL] Avoid illegal order in compare_exchange_* #19723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

robertszafa
Copy link

The atomic_ref compare_exchange_* functions, which take only one memory order argument, call the respective compare_exchange_* functions, which take two memory order arguments, and use the same order for both the success and failure memory orders. This might result in UB where the 'acquire' or 'release' failure order is used. This commit ensures that an illegal failure order is never passed.

The atomic_ref compare_exchange_* functions, which take only one
memory order argument, call the respective compare_exchange_*
functions, which take two memory order arguments, and use the same
order for both the success and failure memory orders. This might
result in UB, where the 'acquire' or 'release' failure order is used.
This commit ensures that an illegal failure order is never passed.
@robertszafa robertszafa requested a review from a team as a code owner August 6, 2025 12:00
@robertszafa
Copy link
Author

robertszafa commented Aug 6, 2025

Hold off on merging until KhronosGroup/SYCL-Docs#891 is merged. This is a follow up PR to intel/llvm#19513.

@robertszafa
Copy link
Author

Ready to review @sergey-semenov. This PR directly implements the clarification from KhronosGroup/SYCL-Docs#891.

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