diff --git a/source/adapters/level_zero/usm.cpp b/source/adapters/level_zero/usm.cpp index daec0408fb..d06a0353e4 100644 --- a/source/adapters/level_zero/usm.cpp +++ b/source/adapters/level_zero/usm.cpp @@ -192,14 +192,8 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); - // TODO: Return any non-success result from USMAllocationMakeResident once - // oneapi-src/level-zero-spec#240 is resolved. - auto Result = USMAllocationMakeResident(USMDeviceAllocationForceResidency, - Context, Device, *ResultPtr, Size); - if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY || - Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) { - return Result; - } + USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, Device, + *ResultPtr, Size); return UR_RESULT_SUCCESS; } @@ -231,14 +225,8 @@ static ur_result_t USMSharedAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); - // TODO: Return any non-success result from USMAllocationMakeResident once - // oneapi-src/level-zero-spec#240 is resolved. - auto Result = USMAllocationMakeResident(USMSharedAllocationForceResidency, - Context, Device, *ResultPtr, Size); - if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY || - Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) { - return Result; - } + USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, Device, + *ResultPtr, Size); // TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY. return UR_RESULT_SUCCESS; @@ -259,14 +247,8 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); - // TODO: Return any non-success result from USMAllocationMakeResident once - // oneapi-src/level-zero-spec#240 is resolved. - auto Result = USMAllocationMakeResident(USMHostAllocationForceResidency, - Context, nullptr, *ResultPtr, Size); - if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY || - Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) { - return Result; - } + USMAllocationMakeResident(USMHostAllocationForceResidency, Context, nullptr, + *ResultPtr, Size); return UR_RESULT_SUCCESS; }