Skip to content

Commit 77243d2

Browse files
authored
[SYCL] [NATIVECPU] Fix no-opt.cpp test (#11475)
The test was missing a `RUN` directive.
1 parent 6eb0c72 commit 77243d2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sycl/test/native_cpu/no-opt.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=native_cpu -O0 -o %t.bc %s
1+
// REQUIRES: native_cpu_be
2+
// RUN: %clangxx -fsycl -fsycl-targets=native_cpu -g -O0 -o %t %s
3+
// RUN: env ONEAPI_DEVICE_SELECTOR="native_cpu:cpu" %t
24

35
#include "sycl.hpp"
46
class Test1;
57
int main() {
68
const size_t N = 4;
79
sycl::buffer<size_t, 1> Buffer(N);
810
sycl::queue deviceQueue;
9-
sycl::accessor<int, 1, sycl::access::mode::write> acc;
10-
sycl::range<1> r(1);
11+
sycl::range<1> r(N);
1112
deviceQueue
1213
.submit([&](sycl::handler &h) {
13-
sycl::accessor Accessor{Buffer, h, sycl::write_only};
14-
h.parallel_for<Test1>(r, [=](sycl::id<1> id) { acc[id[0]] = 42; });
14+
auto Accessor = Buffer.get_access<sycl::access::mode::write>(h);
15+
h.parallel_for<Test1>(r, [=](sycl::id<1> id) { Accessor[id[0]] = 42; });
1516
})
1617
.wait();
1718
sycl::host_accessor HostAccessor{Buffer, sycl::read_only};

0 commit comments

Comments
 (0)