From 657ffde9a7fa720eb08bade5878287f383a9da79 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Thu, 19 Oct 2023 11:47:51 +0100 Subject: [PATCH] Revert "[UR][L0] Propagate errors from `USMAllocationMakeResident`" --- source/adapters/level_zero/usm.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/adapters/level_zero/usm.cpp b/source/adapters/level_zero/usm.cpp index d75f3872b1..d06a0353e4 100644 --- a/source/adapters/level_zero/usm.cpp +++ b/source/adapters/level_zero/usm.cpp @@ -192,8 +192,9 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); - return USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, - Device, *ResultPtr, Size); + USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, Device, + *ResultPtr, Size); + return UR_RESULT_SUCCESS; } static ur_result_t USMSharedAllocImpl(void **ResultPtr, @@ -224,9 +225,11 @@ static ur_result_t USMSharedAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); + USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, Device, + *ResultPtr, Size); + // TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY. - return USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, - Device, *ResultPtr, Size); + return UR_RESULT_SUCCESS; } static ur_result_t USMHostAllocImpl(void **ResultPtr, @@ -244,8 +247,9 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr, reinterpret_cast(*ResultPtr) % Alignment == 0, UR_RESULT_ERROR_INVALID_VALUE); - return USMAllocationMakeResident(USMHostAllocationForceResidency, Context, - nullptr, *ResultPtr, Size); + USMAllocationMakeResident(USMHostAllocationForceResidency, Context, nullptr, + *ResultPtr, Size); + return UR_RESULT_SUCCESS; } UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(