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+
44#include < sycl/sycl.hpp>
55
66constexpr size_t N = 64 ;
77
88int main () {
99 sycl::queue Q;
1010 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+
1120 sycl::free (data, Q);
1221 return 0 ;
1322}
You can’t perform that action at this time.
0 commit comments