Skip to content

Commit 8c21271

Browse files
author
Kenneth Benzie (Benie)
authored
[SYCL] Also check for use of SYCL_PI_TRACE on Linux (#15113)
As part of removing the plugin interface a check was added for the use of the `SYCL_PI_TRACE` environment variable. However, this was only applied on the Windows path. This patch moves this check to a common path for both Windows and Linux.
1 parent a42ae7e commit 8c21271

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

sycl/source/detail/global_handler.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,6 @@ void shutdown_late() {
355355
extern "C" __SYCL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL,
356356
DWORD fdwReason,
357357
LPVOID lpReserved) {
358-
// TODO: Remove from public header files and implementation during the next
359-
// ABI Breaking window.
360-
if (std::getenv("SYCL_PI_TRACE")) {
361-
std::cerr << "SYCL_PI_TRACE has been removed use SYCL_UR_TRACE instead\n";
362-
std::exit(1);
363-
}
364-
365358
bool PrintUrTrace =
366359
sycl::detail::ur::trace(sycl::detail::ur::TraceLevel::TRACE_CALLS);
367360

sycl/source/detail/ur.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ std::vector<PluginPtr> &initializeUr(ur_loader_config_handle_t LoaderConfig) {
9191
// std::call_once is blocking all other threads if a thread is already
9292
// creating a vector of plugins. So, no additional lock is needed.
9393
std::call_once(PluginsInitDone, [&]() {
94+
// TODO: Remove this SYCL_PI_TRACE notification in the first patch release
95+
// after the next ABI breaking window.
96+
if (std::getenv("SYCL_PI_TRACE")) {
97+
std::cerr << "SYCL_PI_TRACE has been removed use SYCL_UR_TRACE instead\n";
98+
std::exit(1);
99+
}
100+
94101
initializePlugins(GlobalHandler::instance().getPlugins(), LoaderConfig);
95102
});
96103
return GlobalHandler::instance().getPlugins();

0 commit comments

Comments
 (0)