From 307a055c1a9a5f858af0d8121be2a050324ee3ec Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Tue, 2 Dec 2025 12:27:19 -0800 Subject: [PATCH 1/2] [SYCL] Promote breaking changes for logical operations --- sycl/include/sycl/functional.hpp | 16 ---------------- sycl/test/basic_tests/logical_operations.cpp | 8 -------- .../logical_or_and_group_algorithms.cpp | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/sycl/include/sycl/functional.hpp b/sycl/include/sycl/functional.hpp index e0201e0a64a40..3e0c8383937ce 100644 --- a/sycl/include/sycl/functional.hpp +++ b/sycl/include/sycl/functional.hpp @@ -23,25 +23,9 @@ template using bit_xor = std::bit_xor; // std:logical_and/std::logical_or with a non-void type returns bool, // sycl requires returning T. -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES template struct logical_and : std::logical_and {}; template struct logical_or : std::logical_or {}; -#else -template struct logical_and { - T operator()(const T &lhs, const T &rhs) const { return lhs && rhs; } -}; - -template <> struct logical_and : std::logical_and {}; - -template struct logical_or { - T operator()(const T &lhs, const T &rhs) const { return lhs || rhs; } -}; - -template <> struct logical_or : std::logical_or {}; - -#endif - // sycl::minimum definition should be consistent with std::min template struct minimum { T operator()(const T &lhs, const T &rhs) const { diff --git a/sycl/test/basic_tests/logical_operations.cpp b/sycl/test/basic_tests/logical_operations.cpp index e040470cecd04..ccd052ba323ba 100644 --- a/sycl/test/basic_tests/logical_operations.cpp +++ b/sycl/test/basic_tests/logical_operations.cpp @@ -1,4 +1,3 @@ -// RUN: %clang -fpreview-breaking-changes -fsycl -fsyntax-only %s // RUN: %clang -fsycl -fsyntax-only %s #include @@ -10,16 +9,9 @@ int main() { const auto logicalOr = sycl::logical_or(); const auto logicalAndVoid = sycl::logical_and(); const auto logicalOrVoid = sycl::logical_or(); -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); -#else - static_assert(std::is_same_v); - static_assert(std::is_same_v); - static_assert(std::is_same_v); - static_assert(std::is_same_v); -#endif return 0; } diff --git a/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp b/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp index 5553efe364fbc..15ff3a7e5bd0b 100644 --- a/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp +++ b/sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl -Xclang -verify=expected -Xclang -verify-ignore-unexpected=note -fpreview-breaking-changes -fsyntax-only -fsycl-device-only -ferror-limit=0 %s +// RUN: %clangxx -fsycl -Xclang -verify=expected -Xclang -verify-ignore-unexpected=note -fsyntax-only -fsycl-device-only -ferror-limit=0 %s #include From a0e25d5a8af0d5ce6e028da2bfe0c1f5c0ca8be9 Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Thu, 4 Dec 2025 10:55:07 -0800 Subject: [PATCH 2/2] Remove comment which is not relevant anymore --- sycl/include/sycl/functional.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sycl/include/sycl/functional.hpp b/sycl/include/sycl/functional.hpp index 3e0c8383937ce..0f7acdeb93c19 100644 --- a/sycl/include/sycl/functional.hpp +++ b/sycl/include/sycl/functional.hpp @@ -20,9 +20,6 @@ template using multiplies = std::multiplies; template using bit_and = std::bit_and; template using bit_or = std::bit_or; template using bit_xor = std::bit_xor; - -// std:logical_and/std::logical_or with a non-void type returns bool, -// sycl requires returning T. template struct logical_and : std::logical_and {}; template struct logical_or : std::logical_or {};