From aef388f0bb83fbba0aa37e8f5908f15e6195a085 Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Thu, 27 Aug 2026 18:15:06 +0200 Subject: [PATCH 1/2] Add default constructor to nd_range The range and id classes are default constructible, but nd_range is not: its only constructor requires the global and local ranges, which a user may not know at the point where the nd_range object has to be created. Add nd_range() noexcept, which default constructs the global range, the local range and the (deprecated) offset, so that every component is 0. Fixes KhronosGroup/SYCL-Docs#1043 --- adoc/chapters/programming_interface.adoc | 9 +++++++++ adoc/headers/ndRange.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 180221dd7..2ba61402e 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -12524,6 +12524,15 @@ listed in <> in <> and [width="100%",options="header",separator="@",cols="65%,35%"] |==== @ Constructor @ Description +a@ +[source] +---- +nd_range() noexcept; +---- + a@ Construct an [code]#nd_range# whose global range, local range and + offset are each default constructed, which means that each of their + components has the value [code]#0#. + a@ [source] ---- diff --git a/adoc/headers/ndRange.h b/adoc/headers/ndRange.h index bcdf4fd1d..0fae4628d 100644 --- a/adoc/headers/ndRange.h +++ b/adoc/headers/ndRange.h @@ -6,6 +6,8 @@ template class nd_range { public: static constexpr int dimensions = Dimensions; + nd_range() noexcept; + /* -- common interface members -- */ // The offset is deprecated in SYCL 2020. From 2396db7edbcc321a911dc4b2c1d522465c2a058a Mon Sep 17 00:00:00 2001 From: "Kornev, Nikita" Date: Thu, 27 Aug 2026 19:19:09 +0200 Subject: [PATCH 2/2] Move the nd_range constructors above the common interface members In the nd_range synopsis the /* -- common interface members -- */ marker sat above the globalSize/localSize/offset constructor, so that constructor appeared to be part of the common interface. In the range and id synopses all constructors are listed before the marker and only the members of the common interface follow it. Move the marker below both constructors to match. Co-Authored-By: Claude Opus 5 --- adoc/headers/ndRange.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adoc/headers/ndRange.h b/adoc/headers/ndRange.h index 0fae4628d..1d83345f5 100644 --- a/adoc/headers/ndRange.h +++ b/adoc/headers/ndRange.h @@ -8,12 +8,12 @@ template class nd_range { nd_range() noexcept; - /* -- common interface members -- */ - // The offset is deprecated in SYCL 2020. nd_range(range globalSize, range localSize, id offset = id()) noexcept; + /* -- common interface members -- */ + range get_global_range() const noexcept; range get_local_range() const noexcept; range get_group_range() const noexcept;