9
9
// ===----------------------------------------------------------------------===//
10
10
11
11
#include " adapter.hpp"
12
+ #include " common.hpp"
12
13
#include " ur_level_zero.hpp"
13
14
#include < iomanip>
14
15
@@ -162,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms,
162
163
ZE2UR_CALL (zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data ()));
163
164
}
164
165
if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0 ) {
165
- logger::debug (" \n No Valid L0 Drivers found.\n " );
166
+ logger::error (" \n No Valid L0 Drivers found.\n " );
166
167
return UR_RESULT_SUCCESS;
167
168
}
168
169
@@ -376,7 +377,9 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
376
377
static_cast <int >(L0InitFlags));
377
378
GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK (zeInit, (L0InitFlags));
378
379
if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) {
379
- logger::debug (" \n zeInit failed with {}\n " , GlobalAdapter->ZeInitResult );
380
+ const char *ErrorString = " Unknown" ;
381
+ zeParseError (GlobalAdapter->ZeInitResult , ErrorString);
382
+ logger::error (" \n zeInit failed with {}\n " , ErrorString);
380
383
}
381
384
382
385
bool useInitDrivers = false ;
@@ -422,8 +425,9 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
422
425
if (GlobalAdapter->ZeInitDriversResult == ZE_RESULT_SUCCESS) {
423
426
GlobalAdapter->InitDriversSupported = true ;
424
427
} else {
425
- logger::debug (" \n zeInitDrivers failed with {}\n " ,
426
- GlobalAdapter->ZeInitDriversResult );
428
+ const char *ErrorString = " Unknown" ;
429
+ zeParseError (GlobalAdapter->ZeInitDriversResult , ErrorString);
430
+ logger::error (" \n zeInitDrivers failed with {}\n " , ErrorString);
427
431
}
428
432
}
429
433
}
@@ -441,6 +445,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
441
445
442
446
// Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms.
443
447
if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) {
448
+ logger::error (" Level Zero Uninitialized\n " );
444
449
result = std::move (platforms);
445
450
return ;
446
451
}
0 commit comments