Skip to content

Commit 2e19873

Browse files
authored
[SYCL] Remove operator name keywords (#1501)
Some libraries require -fno-operator-names, and so we should avoid using operator name keywords in SYCL headers. Add regression test for operator names Signed-off-by: John Pennycook <[email protected]>
1 parent 82b93be commit 2e19873

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

sycl/include/CL/sycl/intel/group_algorithm.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ template <typename Group> bool none_of(Group g, bool pred) {
217217
"Group algorithms only support the sycl::group and "
218218
"intel::sub_group class.");
219219
#ifdef __SYCL_DEVICE_ONLY__
220-
return detail::spirv::GroupAll<Group>(not pred);
220+
return detail::spirv::GroupAll<Group>(!pred);
221221
#else
222222
throw runtime_error("Group algorithms are not supported on host device.",
223223
PI_INVALID_DEVICE);
@@ -239,7 +239,7 @@ EnableIfIsPointer<Ptr, bool> none_of(Group g, Ptr first, Ptr last,
239239
static_assert(detail::is_generic_group<Group>::value,
240240
"Group algorithms only support the sycl::group and "
241241
"intel::sub_group class.");
242-
return not any_of(g, first, last, pred);
242+
return !any_of(g, first, last, pred);
243243
#else
244244
throw runtime_error("Group algorithms are not supported on host device.",
245245
PI_INVALID_DEVICE);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %clangxx -fsycl -c %s -o %t.out -Wno-deprecated -fno-operator-names
2+
//
3+
//===----------------------------------------------------------------------===//
4+
// This test checks if any SYCL header files use C++ operator name keywords
5+
// e.g. and, or, not
6+
//
7+
// This test does not use -fsyntax-only because it does not appear to respect
8+
// the -fno-operator-names option
9+
//===----------------------------------------------------------------------===//
10+
11+
#include <CL/sycl.hpp>

0 commit comments

Comments
 (0)