Skip to content

Commit f645315

Browse files
authored
[SYCL][E2E] Fix event_destruction test running for too long at O0 (#22496)
The kernel body was doing unnecessary work that dominated runtime at O0 taking around 35 min to complete. Simplify it to a trivial write, the test only needs the event dependency chain to exist, not the kernel to do real work.
1 parent d802e23 commit f645315

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

sycl/test-e2e/Regression/event_destruction.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@
88
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
99
//
1010
//===----------------------------------------------------------------------===//
11-
#include <iostream>
12-
1311
#include <sycl/detail/core.hpp>
1412

1513
const size_t ITERS = 100000;
1614

17-
// The test checks that that event destruction does not lead to stack overflow
15+
// The test checks that event destruction does not cause a stack overflow.
16+
// The SYCL scheduler builds a chain of dependent event_impl objects; if their
17+
// destructors recurse into each other the host stack overflows.
1818

1919
int main() {
2020
sycl::queue Q;
21-
sycl::buffer<int, 1> Buf(3000);
21+
sycl::buffer<int, 1> Buf(1);
2222
for (size_t Idx = 0; Idx < ITERS; ++Idx) {
2323
auto Event = Q.submit([&](sycl::handler &cgh) {
2424
auto Acc = Buf.get_access<sycl::access::mode::write>(cgh);
25-
cgh.single_task([=]() {
26-
for (size_t I = 0; I < 2000; I++) {
27-
Acc[I] = I * I + 2000;
28-
}
29-
});
25+
cgh.single_task([=]() { Acc[0] = 1; });
3026
});
3127
Event.wait();
3228
}

0 commit comments

Comments
 (0)