File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 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
2
4
3
5
#include " sycl.hpp"
4
6
class Test1 ;
5
7
int main () {
6
8
const size_t N = 4 ;
7
9
sycl::buffer<size_t , 1 > Buffer (N);
8
10
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);
11
12
deviceQueue
12
13
.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 ; });
15
16
})
16
17
.wait ();
17
18
sycl::host_accessor HostAccessor{Buffer, sycl::read_only};
You can’t perform that action at this time.
0 commit comments