Skip to content

Commit 7e1bf63

Browse files
authored
[SYCL][DeviceSanitizer] Add a test for demangle kernel name (#12948)
Add a test for demangle kernel name for UR PR oneapi-src/unified-runtime#1355
1 parent a6301e9 commit 7e1bf63

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// REQUIRES: linux, cpu
2+
// RUN: %{build} %device_sanitizer_flags -O2 -g -o %t
3+
// RUN: env SYCL_PREFER_UR=1 %{run} not %t &> %t.txt ; FileCheck --input-file %t.txt %s
4+
#include <sycl/sycl.hpp>
5+
6+
int main() {
7+
sycl::queue Q;
8+
constexpr std::size_t N = 16;
9+
auto *array = sycl::malloc_device<int>(N, Q);
10+
11+
Q.submit([&](sycl::handler &h) {
12+
h.parallel_for<class MyKernel>(
13+
sycl::nd_range<1>(N + 1, 1),
14+
[=](sycl::nd_item<1> item) { ++array[item.get_global_id(0)]; });
15+
});
16+
Q.wait();
17+
// CHECK: kernel <typeinfo name for main::{lambda(sycl::_V1::handler&)#1}::operator()(sycl::_V1::handler&) const::MyKernel>
18+
19+
sycl::free(array, Q);
20+
return 0;
21+
}

0 commit comments

Comments
 (0)