Skip to content

Commit 69a552b

Browse files
committed
Add env variable to explicitly disable logger callback sink as it interferes with some e2e tests
1 parent e252335 commit 69a552b

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

sycl/source/detail/ur.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ static void initializeAdapters(std::vector<AdapterPtr> &Adapters,
230230
auto syclBackend = UrToSyclBackend(adapterBackend);
231231
Adapters.emplace_back(std::make_shared<Adapter>(UrAdapter, syclBackend));
232232

233-
CHECK_UR_SUCCESS(adapterSetLoggerCallback(UrAdapter, urLoggerCallback,
234-
nullptr, UR_LOGGER_LEVEL_INFO));
233+
const char *env_value = std::getenv("UR_LOG_CALLBACK");
234+
if (env_value == nullptr || std::string(env_value) != "disabled") {
235+
CHECK_UR_SUCCESS(adapterSetLoggerCallback(UrAdapter, urLoggerCallback,
236+
nullptr, UR_LOGGER_LEVEL_INFO));
237+
}
235238
}
236239

237240
#ifdef XPTI_ENABLE_INSTRUMENTATION

sycl/test-e2e/External/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,3 @@ cmake \
7676
make check-sycl-e2e
7777
7878
```
79-

sycl/test-e2e/lit.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@
168168
lit_config.note("\tUnset " + var)
169169
llvm_config.with_environment(var, "")
170170

171+
# Disable the UR logger callback sink during test runs as output to SYCL RT can interfere with some tests relying on standard input/output
172+
llvm_config.with_environment("UR_LOG_CALLBACK", "disabled")
171173

172174
# Temporarily modify environment to be the same that we use when running tests
173175
class test_env:

sycl/test/Unit/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ def find_shlibpath_var():
9595

9696
config.environment["SYCL_CACHE_DIR"] = config.llvm_obj_root + "/sycl_cache"
9797
lit_config.note("SYCL cache directory: {}".format(config.environment["SYCL_CACHE_DIR"]))
98+
99+
# Disable the UR logger callback sink during test runs as output to SYCL RT can interfere with some tests relying on standard input/output
100+
config.environment["UR_LOG_CALLBACK"] = "disabled"

sycl/test/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
)
187187
)
188188

189+
# Disable the UR logger callback sink during test runs as output to SYCL RT can interfere with some tests relying on standard input/output
190+
llvm_config.with_environment("UR_LOG_CALLBACK", "disabled")
191+
189192
# Dump-only tests do not have clang available
190193
if not dump_only_tests:
191194
llvm_config.use_clang(additional_flags=additional_flags)

0 commit comments

Comments
 (0)