Skip to content

Commit 861ef3d

Browse files
committed
[UR][L0] Make umfPoolMallocUsableSize optional ...
in sync allocations, when its unsupported by the pool implementation. This accommodates cases like the UMF proxy pool, which does not support this functionality.
1 parent 9b44298 commit 861ef3d

File tree

1 file changed

+4
-2
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+4
-2
lines changed

unified-runtime/source/adapters/level_zero/usm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,8 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context,
12501250

12511251
size_t UsableSize = 0;
12521252
auto UmfRet = umfPoolMallocUsableSize(UmfPool, *RetMem, &UsableSize);
1253-
if (UmfRet != UMF_RESULT_SUCCESS) {
1253+
if (UmfRet != UMF_RESULT_SUCCESS &&
1254+
UmfRet != UMF_RESULT_ERROR_NOT_SUPPORTED) {
12541255
return umf::umf2urResult(UmfRet);
12551256
}
12561257

@@ -1263,7 +1264,8 @@ ur_result_t ur_usm_pool_handle_t_::free(void *Mem,
12631264
umf_memory_pool_handle_t UmfPool) {
12641265
size_t Size = 0;
12651266
auto UmfRet = umfPoolMallocUsableSize(UmfPool, Mem, &Size);
1266-
if (UmfRet != UMF_RESULT_SUCCESS) {
1267+
if (UmfRet != UMF_RESULT_SUCCESS &&
1268+
UmfRet != UMF_RESULT_ERROR_NOT_SUPPORTED) {
12671269
return umf::umf2urResult(UmfRet);
12681270
}
12691271

0 commit comments

Comments
 (0)