File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
sycl/test-e2e/AddressSanitizer/common Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments