From 90ad035258174e51af7f99fb54f277b7cb013036 Mon Sep 17 00:00:00 2001 From: Robertkq Date: Tue, 4 Aug 2026 22:42:21 +0300 Subject: [PATCH 1/6] align nd_range to specs for next release --- sycl/include/sycl/nd_range.hpp | 43 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index 8d1fd28c2bedc..c67e5fb9b1cdc 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -21,6 +21,14 @@ class nd_range_view; } } // namespace detail +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +// remove this __NOEXCEPT macro on next release, and replace with noexcept +// directly +#define __NOEXCEPT +#else +#define __NOEXCEPT noexcept +#endif // __INTEL_PREVIEW_BREAKING_CHANGES + /// Defines the iteration domain of both the work-groups and the overall /// dispatch. /// @@ -39,21 +47,25 @@ template class nd_range { public: __SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020") nd_range(range globalSize, range localSize, - id offset) - : globalSize(globalSize), localSize(localSize), offset(offset) {} + id offset) __NOEXCEPT : globalSize(globalSize), + localSize(localSize), + offset(offset) {} - nd_range(range globalSize, range localSize) - : globalSize(globalSize), localSize(localSize), offset(id()) { - } + nd_range(range globalSize, range localSize) __NOEXCEPT + : globalSize(globalSize), + localSize(localSize), + offset(id()) {} - range get_global_range() const { return globalSize; } + range get_global_range() const __NOEXCEPT { return globalSize; } - range get_local_range() const { return localSize; } + range get_local_range() const __NOEXCEPT { return localSize; } - range get_group_range() const { return globalSize / localSize; } + range get_group_range() const __NOEXCEPT { + return globalSize / localSize; + } __SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020") - id get_offset() const { return offset; } + id get_offset() const __NOEXCEPT { return offset; } // Common special member functions for by-value semantics nd_range(const nd_range &rhs) = default; @@ -63,6 +75,7 @@ template class nd_range { nd_range() = default; // Common member functions for by-value semantics +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES bool operator==(const nd_range &rhs) const { return (rhs.globalSize == this->globalSize) && (rhs.localSize == this->localSize) && (rhs.offset == this->offset); @@ -71,6 +84,18 @@ template class nd_range { bool operator!=(const nd_range &rhs) const { return !(*this == rhs); } +#else + friend bool operator==(const nd_range &lhs, + const nd_range &rhs) { + return (lhs.globalSize == rhs.globalSize) && + (lhs.localSize == rhs.localSize) && (lhs.offset == rhs.offset); + } + + friend bool operator!=(const nd_range &lhs, + const nd_range &rhs) { + return !(*this == rhs); + } +#endif // __INTEL_PREVIEW_BREAKING_CHANGES friend class sycl::_V1::detail::nd_range_view; }; From 046398fe83a50ef5067abb870ef035930356d20d Mon Sep 17 00:00:00 2001 From: Robertkq Date: Tue, 4 Aug 2026 23:12:50 +0300 Subject: [PATCH 2/6] small fix --- sycl/include/sycl/nd_range.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index c67e5fb9b1cdc..4add5ed9a92b1 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -93,7 +93,7 @@ template class nd_range { friend bool operator!=(const nd_range &lhs, const nd_range &rhs) { - return !(*this == rhs); + return !(lhs == rhs); } #endif // __INTEL_PREVIEW_BREAKING_CHANGES From 4edf9e69cf5c24cdb7168a869a468ab79ed95899 Mon Sep 17 00:00:00 2001 From: Robertkq Date: Wed, 5 Aug 2026 18:04:11 +0300 Subject: [PATCH 3/6] remove guards as no ABI breakage issue --- sycl/include/sycl/nd_range.hpp | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index 4add5ed9a92b1..64d2ef2c6663c 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -21,14 +21,6 @@ class nd_range_view; } } // namespace detail -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES -// remove this __NOEXCEPT macro on next release, and replace with noexcept -// directly -#define __NOEXCEPT -#else -#define __NOEXCEPT noexcept -#endif // __INTEL_PREVIEW_BREAKING_CHANGES - /// Defines the iteration domain of both the work-groups and the overall /// dispatch. /// @@ -47,25 +39,23 @@ template class nd_range { public: __SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020") nd_range(range globalSize, range localSize, - id offset) __NOEXCEPT : globalSize(globalSize), - localSize(localSize), - offset(offset) {} + id offset) noexcept + : globalSize(globalSize), localSize(localSize), offset(offset) {} - nd_range(range globalSize, range localSize) __NOEXCEPT - : globalSize(globalSize), - localSize(localSize), - offset(id()) {} + nd_range(range globalSize, range localSize) noexcept + : globalSize(globalSize), localSize(localSize), offset(id()) { + } - range get_global_range() const __NOEXCEPT { return globalSize; } + range get_global_range() const noexcept { return globalSize; } - range get_local_range() const __NOEXCEPT { return localSize; } + range get_local_range() const noexcept { return localSize; } - range get_group_range() const __NOEXCEPT { + range get_group_range() const noexcept { return globalSize / localSize; } __SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020") - id get_offset() const __NOEXCEPT { return offset; } + id get_offset() const noexcept { return offset; } // Common special member functions for by-value semantics nd_range(const nd_range &rhs) = default; @@ -75,7 +65,6 @@ template class nd_range { nd_range() = default; // Common member functions for by-value semantics -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES bool operator==(const nd_range &rhs) const { return (rhs.globalSize == this->globalSize) && (rhs.localSize == this->localSize) && (rhs.offset == this->offset); @@ -84,7 +73,6 @@ template class nd_range { bool operator!=(const nd_range &rhs) const { return !(*this == rhs); } -#else friend bool operator==(const nd_range &lhs, const nd_range &rhs) { return (lhs.globalSize == rhs.globalSize) && @@ -95,7 +83,6 @@ template class nd_range { const nd_range &rhs) { return !(lhs == rhs); } -#endif // __INTEL_PREVIEW_BREAKING_CHANGES friend class sycl::_V1::detail::nd_range_view; }; From 94e5ed1bb083345e8d53edc860ee02725a4322f9 Mon Sep 17 00:00:00 2001 From: Robertkq Date: Wed, 5 Aug 2026 18:36:04 +0300 Subject: [PATCH 4/6] remove duplicate operator== --- sycl/include/sycl/nd_range.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index 64d2ef2c6663c..cdbe8d8c65e37 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -65,14 +65,6 @@ template class nd_range { nd_range() = default; // Common member functions for by-value semantics - bool operator==(const nd_range &rhs) const { - return (rhs.globalSize == this->globalSize) && - (rhs.localSize == this->localSize) && (rhs.offset == this->offset); - } - - bool operator!=(const nd_range &rhs) const { - return !(*this == rhs); - } friend bool operator==(const nd_range &lhs, const nd_range &rhs) { return (lhs.globalSize == rhs.globalSize) && From 01bc787b326a53e0cd1017b38e1784c3977ca8ba Mon Sep 17 00:00:00 2001 From: Robertkq Date: Thu, 6 Aug 2026 16:14:33 +0300 Subject: [PATCH 5/6] add default noexcept destructor explicitly --- sycl/include/sycl/nd_range.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index cdbe8d8c65e37..fc80b39db6a2c 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -63,6 +63,7 @@ template class nd_range { nd_range &operator=(const nd_range &rhs) = default; nd_range &operator=(nd_range &&rhs) = default; nd_range() = default; + ~nd_range() noexcept = default; // Common member functions for by-value semantics friend bool operator==(const nd_range &lhs, From 25b72eef09d222e9fa96131f62a51383acc4c303 Mon Sep 17 00:00:00 2001 From: Robertkq Date: Fri, 7 Aug 2026 15:22:23 +0300 Subject: [PATCH 6/6] address reviews --- sycl/include/sycl/nd_range.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/include/sycl/nd_range.hpp b/sycl/include/sycl/nd_range.hpp index fc80b39db6a2c..1efb3879ca4c7 100644 --- a/sycl/include/sycl/nd_range.hpp +++ b/sycl/include/sycl/nd_range.hpp @@ -63,9 +63,9 @@ template class nd_range { nd_range &operator=(const nd_range &rhs) = default; nd_range &operator=(nd_range &&rhs) = default; nd_range() = default; - ~nd_range() noexcept = default; + ~nd_range() = default; - // Common member functions for by-value semantics + // Common hidden friend functions for by-value semantics friend bool operator==(const nd_range &lhs, const nd_range &rhs) { return (lhs.globalSize == rhs.globalSize) &&