Skip to content

Commit 36cd085

Browse files
committed
Addressed comments from code review.
1 parent 0119913 commit 36cd085

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sycl/test/esimd/esimd_verify.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
// RUN: not %clangxx -fsycl -fsycl-device-only -flegacy-pass-manager -O0 -S %s -o /dev/null 2>&1 | FileCheck %s
44
// RUN: not %clangxx -fsycl -fsycl-device-only -fno-legacy-pass-manager -O0 -S %s -o /dev/null 2>&1 | FileCheck %s
55

6+
#include <CL/sycl.hpp>
67
#include <sycl/ext/intel/esimd.hpp>
78

89
using namespace cl::sycl;
910
using namespace sycl::ext::intel::esimd;
1011

1112
// CHECK-DAG: error: function 'cl::sycl::multi_ptr<{{.+}}> cl::sycl::accessor<{{.+}}>::get_pointer<{{.+}}>() const' is not supported in ESIMD context
1213
// CHECK-DAG: error: function '{{.+}} cl::sycl::accessor<{{.+}}>::operator[]<{{.+}}>({{.+}}) const' is not supported in ESIMD context
14+
// CHECK-DAG: error: function 'cl::sycl::ext::oneapi::detail::reducer<int, std::plus<int>, void>::combine(int const&)' is not supported in ESIMD context
1315

1416
SYCL_EXTERNAL auto
1517
test(accessor<int, 1, access::mode::read_write, access::target::device> &acc)
@@ -22,3 +24,10 @@ test1(accessor<int, 1, access::mode::read_write, access::target::device> &acc)
2224
SYCL_ESIMD_FUNCTION {
2325
acc[0] = 0;
2426
}
27+
28+
void test2(sycl::handler &cgh, int *buf) {
29+
auto reduction = sycl::reduction(buf, sycl::plus<int>());
30+
cgh.parallel_for<class Test2>(sycl::range<1>(1), reduction,
31+
[=](sycl::id<1>, auto &reducer)
32+
SYCL_ESIMD_KERNEL { reducer.combine(15); });
33+
}

0 commit comments

Comments
 (0)