[SYCL] Unconditionally provide the nd_range default constructor - #23043
Merged
Conversation
PR intel#22908 removed nd_range's default constructor to align the class with the SYCL 2020 specification, and PR intel#22949 restored it only outside of preview mode, since the specification does not declare one. KhronosGroup/SYCL-Docs#1043 adds nd_range() to the specification, for the same reason range and id already have one: an nd_range often has to be declared before its global and local ranges are known. With that resolved, there is no reason to keep the constructor and its test behind __INTEL_PREVIEW_BREAKING_CHANGES, so take both out of the guard. All three members (globalSize, localSize, offset) are range/id objects with zero-initializing default constructors, so a default constructed nd_range has the value 0 for every component of its global range, local range and offset. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
@uditagarwal97 could you take a look please? the patch is trivial |
Contributor
|
CI failure seems unrelated. Merging. |
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.
PR #22908 removed nd_range's default constructor to align the class with the SYCL 2020 specification, and PR #22949 restored it only outside of preview mode, since the specification does not declare one.
KhronosGroup/SYCL-Docs#1043 adds nd_range() to the specification, for the same reason range and id already have one: an nd_range often has to be declared before its global and local ranges are known. With that resolved, there is no reason to keep the constructor and its test behind __INTEL_PREVIEW_BREAKING_CHANGES, so take both out of the guard.
All three members (globalSize, localSize, offset) are range/id objects with zero-initializing default constructors, so a default constructed nd_range has the value 0 for every component of its global range, local range and offset.