This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2
+ // RUN: %ACC_RUN_PLACEHOLDER %t.out
3
+ // RUN: %HOST_RUN_PLACEHOLDER %t.out
4
+ // RUN: %CPU_RUN_PLACEHOLDER %t.out
5
+ // RUN: %GPU_RUN_PLACEHOLDER %t.out
6
+
7
+ // ==--------------- event_destruction.cpp - SYCL event test ----------------==//
8
+ //
9
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
10
+ // See https://llvm.org/LICENSE.txt for license information.
11
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
12
+ //
13
+ // ===----------------------------------------------------------------------===//
14
+ #include < CL/sycl.hpp>
15
+ #include < iostream>
16
+
17
+ const size_t ITERS = 100000 ;
18
+
19
+ // The test checks that that event destruction does not lead to stack overflow
20
+
21
+ int main () {
22
+ cl::sycl::default_selector S;
23
+ cl::sycl::queue Q (S);
24
+ cl::sycl::buffer<int , 1 > Buf (3000 );
25
+ for (size_t Idx = 0 ; Idx < ITERS; ++Idx) {
26
+ auto Event = Q.submit ([&](cl::sycl::handler &cgh) {
27
+ auto Acc = Buf.get_access <cl::sycl::access::mode::write>(cgh);
28
+ cgh.single_task ([=]() {
29
+ for (size_t I = 0 ; I < 2000 ; I++) {
30
+ Acc[I] = I * I + 2000 ;
31
+ }
32
+ });
33
+ });
34
+ Event.wait ();
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments