File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
DirectProgramming/C++SYCL/DenseLinearAlgebra/address_sanitizer/src Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
- // REQUIRES: linux
2
- // RUN: %{build} %device_sanitizer_flags -O0 -g -o %t
3
- // RUN: env SYCL_PREFER_UR=1 UR_ENABLE_LAYERS=UR_LAYER_ASAN %{run} not %t 2>&1 | FileCheck --check-prefixes CHECK %s
1
+ // Copyright (C) 2024 Intel Corporation
2
+ // SPDX-License-Identifier: MIT
3
+
4
4
#include < sycl/sycl.hpp>
5
5
6
6
constexpr size_t N = 64 ;
7
7
8
8
int main () {
9
9
sycl::queue Q;
10
10
auto *data = new int [N];
11
+ auto *array = sycl::malloc_device<long long >(N, Q);
12
+
13
+ Q.submit ([&](sycl::handler &h) {
14
+ h.parallel_for <class MyKernel >(
15
+ sycl::nd_range<1 >(N, 1 ),
16
+ [=](sycl::nd_item<1 > item) { ++array[item.get_global_id (0 )]; });
17
+ });
18
+ Q.wait ();
19
+
11
20
sycl::free (data, Q);
12
21
return 0 ;
13
22
}
You can’t perform that action at this time.
0 commit comments