@@ -18,7 +18,7 @@ namespace ze_lib
1818{
1919 // /////////////////////////////////////////////////////////////////////////////
2020 context_t *context = nullptr ;
21- #ifdef DYNAMIC_LOAD_LOADER
21+ #ifdef L0_STATIC_LOADER_BUILD
2222 void context_at_exit_destructor ()
2323 {
2424 if (ze_lib::context) {
@@ -69,7 +69,7 @@ namespace ze_lib
6969 // /////////////////////////////////////////////////////////////////////////////
7070 __zedlllocal context_t ::~context_t ()
7171 {
72- #ifdef DYNAMIC_LOAD_LOADER
72+ #ifdef L0_STATIC_LOADER_BUILD
7373 if (loaderTeardownRegistrationEnabled && !loaderTeardownCallbackReceived) {
7474 loaderTeardownCallback (loaderTeardownCallbackIndex);
7575 }
@@ -92,7 +92,7 @@ namespace ze_lib
9292 {
9393 ze_result_t result;
9494 ze_api_version_t version = ZE_API_VERSION_CURRENT;
95- #ifdef DYNAMIC_LOAD_LOADER
95+ #ifdef L0_STATIC_LOADER_BUILD
9696 std::string loaderLibraryPath;
9797 auto loaderLibraryPathEnv = getenv_string (" ZEL_LIBRARY_PATH" );
9898 if (!loaderLibraryPathEnv.empty ()) {
@@ -213,7 +213,7 @@ namespace ze_lib
213213
214214 // Given zesInit, then zesDrivers needs to be used as the sysmanInstanceDrivers;
215215 bool loaderContextAccessAllowed = true ;
216- #ifdef DYNAMIC_LOAD_LOADER
216+ #ifdef L0_STATIC_LOADER_BUILD
217217 loaderContextAccessAllowed = false ;
218218 loader::context_t *loaderContext = nullptr ;
219219#else
@@ -264,7 +264,7 @@ namespace ze_lib
264264 // Init the stored ddi tables for the tracing layer
265265 if ( ZE_RESULT_SUCCESS == result )
266266 {
267- #ifdef DYNAMIC_LOAD_LOADER
267+ #ifdef L0_STATIC_LOADER_BUILD
268268 if (loaderTracingLayerInit) {
269269 result = loaderTracingLayerInit (this ->pTracingZeDdiTable );
270270 }
@@ -280,7 +280,7 @@ namespace ze_lib
280280 // Check which drivers support the ze_driver_flag_t specified
281281 // No need to check if only initializing sysman
282282 bool requireDdiReinit = false ;
283- #ifdef DYNAMIC_LOAD_LOADER
283+ #ifdef L0_STATIC_LOADER_BUILD
284284 if (zeInitDriversSupport) {
285285 typedef ze_result_t (ZE_APICALL *zelLoaderDriverCheck_t)(ze_init_flags_t flags, ze_init_driver_type_desc_t * desc, ze_global_dditable_t *globalInitStored, zes_global_dditable_t *sysmanGlobalInitStored, bool *requireDdiReinit, bool sysmanOnly);
286286 auto loaderDriverCheck = reinterpret_cast <zelLoaderDriverCheck_t>(
@@ -341,7 +341,7 @@ namespace ze_lib
341341
342342 if ( ZE_RESULT_SUCCESS == result )
343343 {
344- #ifdef DYNAMIC_LOAD_LOADER
344+ #ifdef L0_STATIC_LOADER_BUILD
345345 // Init Dynamic Loader's Lib Context:
346346 auto initDriversLoader = reinterpret_cast <ze_pfnInitDrivers_t>(
347347 GET_FUNCTION_PTR (loader, " zeInitDrivers" ) );
@@ -378,7 +378,7 @@ namespace ze_lib
378378#endif
379379 isInitialized = true ;
380380 }
381- #ifdef DYNAMIC_LOAD_LOADER
381+ #ifdef L0_STATIC_LOADER_BUILD
382382 std::call_once (ze_lib::context->initTeardownCallbacksOnce , [this ]() {
383383 if (!delayContextDestruction) {
384384 std::atexit (context_at_exit_destructor);
@@ -416,7 +416,7 @@ zelLoaderGetVersions(
416416 size_t *num_elems, // Pointer to num versions to get.
417417 zel_component_version_t *versions) // Pointer to array of versions. If set to NULL, num_elems is returned
418418{
419- #ifdef DYNAMIC_LOAD_LOADER
419+ #ifdef L0_STATIC_LOADER_BUILD
420420 if (nullptr == ze_lib::context->loader )
421421 return ZE_RESULT_ERROR_UNINITIALIZED;
422422 typedef ze_result_t (ZE_APICALL *zelLoaderGetVersions_t)(size_t *num_elems, zel_component_version_t *versions);
@@ -436,7 +436,7 @@ zelLoaderTranslateHandle(
436436 void **handleOut)
437437
438438{
439- #ifdef DYNAMIC_LOAD_LOADER
439+ #ifdef L0_STATIC_LOADER_BUILD
440440 if (nullptr == ze_lib::context->loader )
441441 return ZE_RESULT_ERROR_UNINITIALIZED;
442442 typedef ze_result_t (ZE_APICALL *zelLoaderTranslateHandleInternal_t)(zel_handle_type_t handleType, void *handleIn, void **handleOut);
@@ -470,7 +470,7 @@ zelSetDriverTeardown()
470470void ZE_APICALL
471471zelSetDelayLoaderContextTeardown ()
472472{
473- #ifdef DYNAMIC_LOAD_LOADER
473+ #ifdef L0_STATIC_LOADER_BUILD
474474 if (!ze_lib::delayContextDestruction) {
475475 ze_lib::delayContextDestruction = true ;
476476 }
@@ -539,7 +539,7 @@ zelCheckIsLoaderInTearDown() {
539539 if (ze_lib::destruction || ze_lib::context == nullptr ) {
540540 return true ;
541541 }
542- #if defined(DYNAMIC_LOAD_LOADER ) && defined(_WIN32)
542+ #if defined(L0_STATIC_LOADER_BUILD ) && defined(_WIN32)
543543 static bool loaderIsStable = true ;
544544 if (!loaderIsStable) {
545545 if (ze_lib::context->debugTraceEnabled ) {
@@ -594,7 +594,7 @@ zelCheckIsLoaderInTearDown() {
594594void ZE_APICALL
595595zelLoaderContextTeardown ()
596596{
597- #ifdef DYNAMIC_LOAD_LOADER
597+ #ifdef L0_STATIC_LOADER_BUILD
598598 if (ze_lib::delayContextDestruction && ze_lib::context) {
599599 delete ze_lib::context;
600600 ze_lib::context = nullptr ;
@@ -605,7 +605,7 @@ zelLoaderContextTeardown()
605605ze_result_t ZE_APICALL
606606zelEnableTracingLayer ()
607607{
608- #ifdef DYNAMIC_LOAD_LOADER
608+ #ifdef L0_STATIC_LOADER_BUILD
609609 if (nullptr == ze_lib::context->loader )
610610 return ZE_RESULT_ERROR_UNINITIALIZED;
611611 typedef ze_result_t (ZE_APICALL *zelEnableTracingLayerInternal_t)();
@@ -626,7 +626,7 @@ zelEnableTracingLayer()
626626ze_result_t ZE_APICALL
627627zelDisableTracingLayer ()
628628{
629- #ifdef DYNAMIC_LOAD_LOADER
629+ #ifdef L0_STATIC_LOADER_BUILD
630630 if (nullptr == ze_lib::context->loader )
631631 return ZE_RESULT_ERROR_UNINITIALIZED;
632632 typedef ze_result_t (ZE_APICALL *zelDisableTracingLayerInternal_t)();
0 commit comments