Skip to content

[SYCL] Unconditionally provide the nd_range default constructor - #23043

Merged
uditagarwal97 merged 1 commit into
intel:syclfrom
KornevNikita:nd-range-default-ctor
Aug 27, 2026
Merged

[SYCL] Unconditionally provide the nd_range default constructor#23043
uditagarwal97 merged 1 commit into
intel:syclfrom
KornevNikita:nd-range-default-ctor

Conversation

@KornevNikita

Copy link
Copy Markdown
Contributor

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.

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>
@KornevNikita
KornevNikita requested a review from a team as a code owner August 27, 2026 17:24
@KornevNikita

Copy link
Copy Markdown
Contributor Author

@uditagarwal97 could you take a look please? the patch is trivial

@uditagarwal97 uditagarwal97 left a comment

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.

LGTM

@uditagarwal97

Copy link
Copy Markdown
Contributor

CI failure seems unrelated. Merging.

@uditagarwal97
uditagarwal97 merged commit 0bc2229 into intel:sycl Aug 27, 2026
29 of 30 checks passed
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.

2 participants