Skip to content

Commit f2d4fca

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 6ba0d30 commit f2d4fca

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
@@ -1252,7 +1252,8 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context,
12521252

12531253
size_t UsableSize = 0;
12541254
auto UmfRet = umfPoolMallocUsableSize(UmfPool, *RetMem, &UsableSize);
1255-
if (UmfRet != UMF_RESULT_SUCCESS) {
1255+
if (UmfRet != UMF_RESULT_SUCCESS &&
1256+
UmfRet != UMF_RESULT_ERROR_NOT_SUPPORTED) {
12561257
return umf::umf2urResult(UmfRet);
12571258
}
12581259

@@ -1265,7 +1266,8 @@ ur_result_t ur_usm_pool_handle_t_::free(void *Mem,
12651266
umf_memory_pool_handle_t UmfPool) {
12661267
size_t Size = 0;
12671268
auto UmfRet = umfPoolMallocUsableSize(UmfPool, Mem, &Size);
1268-
if (UmfRet != UMF_RESULT_SUCCESS) {
1269+
if (UmfRet != UMF_RESULT_SUCCESS &&
1270+
UmfRet != UMF_RESULT_ERROR_NOT_SUPPORTED) {
12691271
return umf::umf2urResult(UmfRet);
12701272
}
12711273

0 commit comments

Comments
 (0)