Skip to content

Commit 65a1d8a

Browse files
baderromanovvlad
andcommitted
[SYCL][Test] Add test case for using sycl namespace
Signed-off-by: Alexey Bader <[email protected]> Co-authored-by: Vlad Romoanov <[email protected]>
1 parent 6b70ffd commit 65a1d8a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %clangxx -fsycl %s -o %t.out
2+
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
#include <CL/sycl.hpp>
8+
9+
int main() {
10+
::sycl::queue q;
11+
int r = 0;
12+
{
13+
sycl::buffer<int, 1> b(&r, 1);
14+
q.submit([&](sycl::handler &h) {
15+
auto a = b.get_access<sycl::access::mode::write>(h);
16+
h.single_task<class T>([=]() { a[0] = 42; });
17+
});
18+
}
19+
return r - 42;
20+
}

0 commit comments

Comments
 (0)