File tree Expand file tree Collapse file tree 3 files changed +1
-28
lines changed
Expand file tree Collapse file tree 3 files changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -20,28 +20,9 @@ template <typename T = void> using multiplies = std::multiplies<T>;
2020template <typename T = void > using bit_and = std::bit_and<T>;
2121template <typename T = void > using bit_or = std::bit_or<T>;
2222template <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
2723template <typename T = void > struct logical_and : std::logical_and<T> {};
2824template <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
4627template <typename T = void > struct minimum {
4728 T operator ()(const T &lhs, const T &rhs) const {
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments