diff --git a/source/adapters/level_zero/context.cpp b/source/adapters/level_zero/context.cpp index f711fbc4c2..f161fd411d 100644 --- a/source/adapters/level_zero/context.cpp +++ b/source/adapters/level_zero/context.cpp @@ -239,19 +239,25 @@ ur_result_t ur_context_handle_t_::initialize() { // Initialize pool managers. std::tie(Ret, PoolManager) = usm::pool_manager::create(); - if (Ret) + if (Ret) { + urPrint("urContextCreate: unexpected internal error\n"); return Ret; + } std::tie(Ret, ProxyPoolManager) = usm::pool_manager::create(); - if (Ret) + if (Ret) { + urPrint("urContextCreate: unexpected internal error\n"); return Ret; + } std::vector Descs; // Create pool descriptor for every device and subdevice. std::tie(Ret, Descs) = usm::pool_descriptor::create(nullptr, Context); - if (Ret) + if (Ret) { + urPrint("urContextCreate: unexpected internal error\n"); return Ret; + } auto descTypeToDisjointPoolType = [](usm::pool_descriptor &Desc) -> usm::DisjointPoolMemType { @@ -264,7 +270,6 @@ ur_result_t ur_context_handle_t_::initialize() { return (Desc.deviceReadOnly) ? usm::DisjointPoolMemType::SharedReadOnly : usm::DisjointPoolMemType::Shared; default: - assert(0 && "Invalid pool descriptor type!"); // Added to suppress 'not all control paths return a value' warning. return usm::DisjointPoolMemType::All; } @@ -277,15 +282,19 @@ ur_result_t ur_context_handle_t_::initialize() { std::tie(Ret, Pool) = createUMFPoolForDesc( Desc, DisjointPoolConfigInstance.Configs[PoolType]); - if (Ret) + if (Ret) { + urPrint("urContextCreate: unexpected internal error\n"); return Ret; + } PoolManager.addPool(Desc, Pool); umf::pool_unique_handle_t ProxyPool = nullptr; std::tie(Ret, ProxyPool) = createUMFPoolForDesc(Desc); - if (Ret) + if (Ret) { + urPrint("urContextCreate: unexpected internal error\n"); return Ret; + } ProxyPoolManager.addPool(Desc, ProxyPool); } diff --git a/source/adapters/level_zero/usm.cpp b/source/adapters/level_zero/usm.cpp index 208de688f0..d27b36ba42 100644 --- a/source/adapters/level_zero/usm.cpp +++ b/source/adapters/level_zero/usm.cpp @@ -12,6 +12,7 @@ #include #include +#include "common.hpp" #include "context.hpp" #include "event.hpp" #include "usm.hpp" @@ -304,6 +305,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc( if (!hPoolInternalOpt.has_value()) { // Internal error, every L0 context and usm pool should have Host, Device, // Shared and SharedReadOnly UMF pools. + urPrint("urUSMHostAlloc: unexpected internal error\n"); return UR_RESULT_ERROR_UNKNOWN; } @@ -386,6 +388,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc( if (!hPoolInternalOpt.has_value()) { // Internal error, every L0 context and usm pool should have Host, Device, // Shared and SharedReadOnly UMF pools. + urPrint("urUSMDeviceAlloc: unexpected internal error\n"); return UR_RESULT_ERROR_UNKNOWN; } @@ -489,6 +492,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMSharedAlloc( if (!hPoolInternalOpt.has_value()) { // Internal error, every L0 context and usm pool should have Host, Device, // Shared and SharedReadOnly UMF pools. + urPrint("urUSMSharedAlloc: unexpected internal error\n"); return UR_RESULT_ERROR_UNKNOWN; }