Skip to content

Commit cfcc6ac

Browse files
author
Sergey Kanaev
committed
[SYCL] Add a test to see if build succeeds with -Wall -Werror
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent 88784b3 commit cfcc6ac

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

sycl/test/warnings/warnings.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %clangxx -Wall -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -fsycl %s -o %t.out
2+
3+
#include <CL/sycl.hpp>
4+
5+
using namespace cl::sycl;
6+
7+
int main(void) {
8+
// add a very simple kernel to see if compilation succeeds with -Werror
9+
int data1[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
10+
11+
buffer<int, 1> B(data1, range<1>(10), {property::buffer::use_host_ptr()});
12+
queue Q;
13+
Q.submit([&](handler &CGH) {
14+
auto Accessor = B.get_access<access::mode::read_write>(CGH);
15+
CGH.parallel_for<class TheSimpleKernel>(range<1>{10}, [=](id<1> Item) {
16+
Accessor[Item] = 0;
17+
});
18+
});
19+
20+
return 0;
21+
}

0 commit comments

Comments
 (0)