Skip to content

Commit a76e3b1

Browse files
authored
Merge pull request #972 from oneapi-src/revert-906-l0_usm_error_checking
Revert "[UR][L0] Propagate errors from `USMAllocationMakeResident`"
2 parents 3653e58 + 657ffde commit a76e3b1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

source/adapters/level_zero/usm.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr,
192192
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
193193
UR_RESULT_ERROR_INVALID_VALUE);
194194

195-
return USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context,
196-
Device, *ResultPtr, Size);
195+
USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, Device,
196+
*ResultPtr, Size);
197+
return UR_RESULT_SUCCESS;
197198
}
198199

199200
static ur_result_t USMSharedAllocImpl(void **ResultPtr,
@@ -224,9 +225,11 @@ static ur_result_t USMSharedAllocImpl(void **ResultPtr,
224225
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
225226
UR_RESULT_ERROR_INVALID_VALUE);
226227

228+
USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, Device,
229+
*ResultPtr, Size);
230+
227231
// TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY.
228-
return USMAllocationMakeResident(USMSharedAllocationForceResidency, Context,
229-
Device, *ResultPtr, Size);
232+
return UR_RESULT_SUCCESS;
230233
}
231234

232235
static ur_result_t USMHostAllocImpl(void **ResultPtr,
@@ -244,8 +247,9 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr,
244247
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
245248
UR_RESULT_ERROR_INVALID_VALUE);
246249

247-
return USMAllocationMakeResident(USMHostAllocationForceResidency, Context,
248-
nullptr, *ResultPtr, Size);
250+
USMAllocationMakeResident(USMHostAllocationForceResidency, Context, nullptr,
251+
*ResultPtr, Size);
252+
return UR_RESULT_SUCCESS;
249253
}
250254

251255
UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(

0 commit comments

Comments
 (0)