Skip to content

Commit 1dc38df

Browse files
committed
try to disable cleaning up device cache
Signed-off-by: Byoungro So <[email protected]>
1 parent d3b9cda commit 1dc38df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sycl/source/detail/global_handler.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ void shutdown() {
8080
// First, release resources, that may access plugins.
8181
GlobalHandler::instance().MScheduler.Inst.reset(nullptr);
8282
GlobalHandler::instance().MProgramManager.Inst.reset(nullptr);
83+
#ifndef _WIN32
84+
// HACK: there is a problem of L0 driver getting unloaded prematurely on
85+
// Windows. This causes crash while destroying devices in the cache.
8386
GlobalHandler::instance().MPlatformDeviceCache.Inst.reset(nullptr);
87+
#endif
8488

8589
// Call to GlobalHandler::instance().getPlugins() initializes plugins. If
8690
// user application has loaded SYCL runtime, and never called any APIs,
@@ -102,7 +106,9 @@ void shutdown() {
102106
}
103107

104108
#ifdef _WIN32
105-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
109+
extern "C" __SYCL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL,
110+
DWORD fdwReason,
111+
LPVOID lpReserved) {
106112
// Perform actions based on the reason for calling.
107113
switch (fdwReason) {
108114
case DLL_PROCESS_DETACH:

0 commit comments

Comments
 (0)