Skip to content

Commit

Permalink
[L0] Add additional logs to enqueue alloc flow
Browse files Browse the repository at this point in the history
  • Loading branch information
kswiecicki committed Jan 27, 2025
1 parent 8bb5c8a commit a4d0e66
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,15 +1188,27 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context,
UR_CALL(ur::level_zero::urContextRetain(Context));
}

const auto Desc =
usm::pool_descriptor{this, Context, Device, Type, DeviceReadOnly};
logger::debug("enqueueUSMAllocHelper: retrieving an appropriate UMF pool for "
"pool descriptor {}",
Desc);
auto umfPool = getPool(
usm::pool_descriptor{this, Context, Device, Type, DeviceReadOnly});
if (!umfPool) {
return UR_RESULT_ERROR_INVALID_ARGUMENT;
}

logger::debug(
"enqueueUSMAllocHelper: preparing an allocation from the UMF pool {}",
umfPool);

*RetMem = umfPoolAlignedMalloc(umfPool, Size, Alignment);
if (*RetMem == nullptr) {
auto umfRet = umfPoolGetLastAllocationError(umfPool);
logger::error(
"enqueueUSMAllocHelper: allocation from the UMF pool {} failed",
umfPool);
return umf::umf2urResult(umfRet);
}

Expand Down

0 comments on commit a4d0e66

Please sign in to comment.