Skip to content

Commit 8690367

Browse files
[UR] Add isTearDown check to avoid Win teardown issue when SYCL_UR_TRACE is active (#20566)
Tracked this down when the `sycl/test-e2e/Schedulder/HostAccDestruction.cpp` test started timing out on some Win machines. UR has the fix, but it wasn't being used when `SYCL_UR_TRACE` was elected. --------- Signed-off-by: Chris Perkins <[email protected]>
1 parent 26e4c60 commit 8690367

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

sycl/test-e2e/Adapters/dll-detach-order.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: windows
2-
// RUN: env SYCL_UR_TRACE=-1 %{run-unfiltered-devices} sycl-ls | FileCheck %s
2+
// RUN: env SYCL_UR_TRACE=-1 %{run-unfiltered-devices} sycl-ls 2>&1 | FileCheck %s
33

44
// ensure that the adapters are detached AFTER urLoaderTearDown is done
55
// executing

unified-runtime/source/adapters/level_zero/adapter.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ class ur_legacy_sink : public logger::Sink {
4747
const std::string &msg) override {
4848
fprintf(stderr, "%s", msg.c_str());
4949
}
50-
51-
~ur_legacy_sink() {
52-
#if defined(_WIN32)
53-
logger::isTearDowned = true;
54-
#endif
55-
};
5650
};
5751

5852
// Find the corresponding ZesDevice Handle for a given ZeDevice

unified-runtime/source/common/logger/ur_sinks.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Sink {
5353
// using thier own sink class that inherit from logger::Sink.
5454
#if defined(_WIN32)
5555
if (isTearDowned) {
56-
std::cerr << message << "\n";
56+
std::cerr << message;
5757
} else {
5858
print(level, message);
5959
}
@@ -193,7 +193,11 @@ class StderrSink : public Sink {
193193
this->flush_level = flush_lvl;
194194
}
195195

196-
~StderrSink() = default;
196+
~StderrSink() {
197+
#if defined(_WIN32)
198+
logger::isTearDowned = true;
199+
#endif
200+
}
197201
};
198202

199203
class FileSink : public Sink {

0 commit comments

Comments
 (0)