Repository navigation
Fix atomics in early-exit and histogram algorithms - #2914
Open
dmitriy-sobolev wants to merge 3 commits into
Open
dmitriy-sobolev wants to merge 3 commits into
dmitriy-sobolev wants to merge 3 commits into
Conversation
Signed-off-by: Sobolev, Dmitriy <dmitriy.sobolev@intel.com>
dmitriy-sobolev
requested review from
SergeyKopienko,
akukanov and
danhoeflinger
November 20, 2026 23:48
Signed-off-by: Sobolev, Dmitriy <dmitriy.sobolev@intel.com>
Signed-off-by: Sobolev, Dmitriy <dmitriy.sobolev@intel.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change affects early-exit and histogram algorithms:
sycl::memory_order::relaxed, which is a data race. It's fixed by a combo ofsycl::memory_order::releaseandsycl::memory_order::acquire, which established the happens-before relationship.sycl::memory_scope::work_groupandsycl::access::address_space::global_space. It was fine if the atomic accesses were made by a single work-group, but the algorithms do it by different work-groups. They needsycl::memory_scope::device.The last change creates an issue, but it is less severe than the original one.
sycl::memory_scope::devicemay not be supported by any device. The affected devices are unknown. See https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:memory-scope:And then in https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#api:info-device-atomic-memory-scope-capabilities:
The
__atomic_refabstraction was removed to avoid similar issues in the future. It was guarded by_ONEDPL_LIBSYCL_VERSION_LESS_THAN(50500), but there are precedents of removing guards for features requiring even newer implementation, e.g.60200in #2534.