Skip to content

Commit 496d694

Browse files
authored
Merge branch 'adapters' into re-add-extended-deleters
2 parents b002e00 + ab45620 commit 496d694

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* @oneapi-src/unified-runtime-maintain
2+
3+
# Level Zero adapter
4+
source/adapters/level_zero @oneapi-src/unified-runtime-level-zero-write
5+
6+
# CUDA and HIP adapters
7+
source/adapters/cuda @oneapi-src/unified-runtime-cuda-write
8+
source/adapters/hip @oneapi-src/unified-runtime-hip-write

source/adapters/level_zero/context.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,12 @@ ur_result_t ur_context_handle_t_::finalize() {
432432
for (auto &List : ZeComputeCommandListCache) {
433433
for (auto &Item : List.second) {
434434
ze_command_list_handle_t ZeCommandList = Item.first;
435-
if (ZeCommandList)
436-
if (ZeCommandList) {
437-
auto ZeResult =
438-
ZE_CALL_NOCHECK(zeCommandListDestroy, (ZeCommandList));
439-
// Gracefully handle the case that L0 was already unloaded.
440-
if (ZeResult && ZeResult != ZE_RESULT_ERROR_UNINITIALIZED)
441-
return ze2urResult(ZeResult);
442-
}
435+
if (ZeCommandList) {
436+
auto ZeResult = ZE_CALL_NOCHECK(zeCommandListDestroy, (ZeCommandList));
437+
// Gracefully handle the case that L0 was already unloaded.
438+
if (ZeResult && ZeResult != ZE_RESULT_ERROR_UNINITIALIZED)
439+
return ze2urResult(ZeResult);
440+
}
443441
}
444442
}
445443
for (auto &List : ZeCopyCommandListCache) {

source/adapters/level_zero/event.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(
423423
}
424424
}
425425
return ReturnValue(Result);
426-
return UR_RESULT_SUCCESS;
427426
}
428427
case UR_EVENT_INFO_REFERENCE_COUNT: {
429428
return ReturnValue(Event->RefCount.load());

source/adapters/level_zero/usm.cpp

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

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

200199
static ur_result_t USMSharedAllocImpl(void **ResultPtr,
@@ -225,11 +224,9 @@ static ur_result_t USMSharedAllocImpl(void **ResultPtr,
225224
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
226225
UR_RESULT_ERROR_INVALID_VALUE);
227226

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

235232
static ur_result_t USMHostAllocImpl(void **ResultPtr,
@@ -247,9 +244,8 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr,
247244
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
248245
UR_RESULT_ERROR_INVALID_VALUE);
249246

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

255251
UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(

0 commit comments

Comments
 (0)