File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
43
43
set (UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git" )
44
44
endif ()
45
45
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "" )
46
- set (UR_LEVEL_ZERO_LOADER_TAG c4892da92dab13a2d276a18975f9fff4268c2daf )
46
+ set (UR_LEVEL_ZERO_LOADER_TAG v1.21.1 )
47
47
endif ()
48
48
49
49
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
Original file line number Diff line number Diff line change @@ -300,6 +300,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
300
300
ZeInitResult = ZE_RESULT_ERROR_UNINITIALIZED;
301
301
ZesResult = ZE_RESULT_ERROR_UNINITIALIZED;
302
302
303
+ #ifdef UR_STATIC_LEVEL_ZERO
304
+ // Given static linking of the L0 Loader, we must delay the loader's
305
+ // destruction of its context until after the UR Adapter is destroyed.
306
+ zelSetDelayLoaderContextTeardown ();
307
+ #endif
308
+
303
309
if (UrL0Debug & UR_L0_DEBUG_BASIC) {
304
310
logger.setLegacySink (std::make_unique<ur_legacy_sink>());
305
311
};
@@ -672,7 +678,13 @@ ur_result_t urAdapterRelease(ur_adapter_handle_t) {
672
678
if (GlobalAdapter) {
673
679
std::lock_guard<std::mutex> Lock{GlobalAdapter->Mutex };
674
680
if (--GlobalAdapter->RefCount == 0 ) {
675
- return adapterStateTeardown ();
681
+ auto result = adapterStateTeardown ();
682
+ #ifdef UR_STATIC_LEVEL_ZERO
683
+ // Given static linking of the L0 Loader, we must delay the loader's
684
+ // destruction of its context until after the UR Adapter is destroyed.
685
+ zelLoaderContextTeardown ();
686
+ #endif
687
+ return result;
676
688
}
677
689
}
678
690
Original file line number Diff line number Diff line change @@ -470,12 +470,18 @@ ur_result_t ur_platform_handle_t_::initialize() {
470
470
// Check if ImmediateAppendCommandList is supported and initialize the
471
471
// function pointer.
472
472
if (ZeImmediateCommandListAppendExtensionFound) {
473
+ #ifdef UR_STATIC_LEVEL_ZERO
474
+ ZeCommandListImmediateAppendExt
475
+ .zeCommandListImmediateAppendCommandListsExp =
476
+ zeCommandListImmediateAppendCommandListsExp;
477
+ #else
473
478
ZeCommandListImmediateAppendExt
474
479
.zeCommandListImmediateAppendCommandListsExp =
475
480
(ze_pfnCommandListImmediateAppendCommandListsExp_t)
476
481
ur_loader::LibLoader::getFunctionPtr (
477
482
GlobalAdapter->processHandle ,
478
483
" zeCommandListImmediateAppendCommandListsExp" );
484
+ #endif
479
485
ZeCommandListImmediateAppendExt.Supported =
480
486
ZeCommandListImmediateAppendExt
481
487
.zeCommandListImmediateAppendCommandListsExp != nullptr ;
You can’t perform that action at this time.
0 commit comments