Skip to content

Commit 56a1ca3

Browse files
authored
[SYCL] Promote breaking changes for logical operations (#20816)
1 parent 90fbcb1 commit 56a1ca3

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

sycl/include/sycl/functional.hpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,9 @@ template <typename T = void> using multiplies = std::multiplies<T>;
2020
template <typename T = void> using bit_and = std::bit_and<T>;
2121
template <typename T = void> using bit_or = std::bit_or<T>;
2222
template <typename T = void> using bit_xor = std::bit_xor<T>;
23-
24-
// std:logical_and/std::logical_or with a non-void type returns bool,
25-
// sycl requires returning T.
26-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
2723
template <typename T = void> struct logical_and : std::logical_and<T> {};
2824
template <typename T = void> struct logical_or : std::logical_or<T> {};
2925

30-
#else
31-
template <typename T = void> struct logical_and {
32-
T operator()(const T &lhs, const T &rhs) const { return lhs && rhs; }
33-
};
34-
35-
template <> struct logical_and<void> : std::logical_and<void> {};
36-
37-
template <typename T = void> struct logical_or {
38-
T operator()(const T &lhs, const T &rhs) const { return lhs || rhs; }
39-
};
40-
41-
template <> struct logical_or<void> : std::logical_or<void> {};
42-
43-
#endif
44-
4526
// sycl::minimum definition should be consistent with std::min
4627
template <typename T = void> struct minimum {
4728
T operator()(const T &lhs, const T &rhs) const {
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// RUN: %clang -fpreview-breaking-changes -fsycl -fsyntax-only %s
21
// RUN: %clang -fsycl -fsyntax-only %s
32

43
#include <cassert>
@@ -10,16 +9,9 @@ int main() {
109
const auto logicalOr = sycl::logical_or<int>();
1110
const auto logicalAndVoid = sycl::logical_and<void>();
1211
const auto logicalOrVoid = sycl::logical_or<void>();
13-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1412
static_assert(std::is_same_v<decltype(logicalAnd(1, 2)), bool>);
1513
static_assert(std::is_same_v<decltype(logicalOr(1, 2)), bool>);
1614
static_assert(std::is_same_v<decltype(logicalAndVoid(1, 2)), bool>);
1715
static_assert(std::is_same_v<decltype(logicalOrVoid(1, 2)), bool>);
18-
#else
19-
static_assert(std::is_same_v<decltype(logicalAnd(1, 2)), int>);
20-
static_assert(std::is_same_v<decltype(logicalOr(1, 2)), int>);
21-
static_assert(std::is_same_v<decltype(logicalAndVoid(1, 2)), bool>);
22-
static_assert(std::is_same_v<decltype(logicalOrVoid(1, 2)), bool>);
23-
#endif
2416
return 0;
2517
}

sycl/test/group_algorithms/logical_or_and_group_algorithms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -Xclang -verify=expected -Xclang -verify-ignore-unexpected=note -fpreview-breaking-changes -fsyntax-only -fsycl-device-only -ferror-limit=0 %s
1+
// RUN: %clangxx -fsycl -Xclang -verify=expected -Xclang -verify-ignore-unexpected=note -fsyntax-only -fsycl-device-only -ferror-limit=0 %s
22

33
#include <sycl/group_algorithm.hpp>
44

0 commit comments

Comments
 (0)