Skip to content

Commit

Permalink
Merge branch 'adapters' into re-add-extended-deleters
Browse files Browse the repository at this point in the history
  • Loading branch information
hdelan committed Oct 16, 2023
2 parents b002e00 + ab45620 commit 496d694
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* @oneapi-src/unified-runtime-maintain

# Level Zero adapter
source/adapters/level_zero @oneapi-src/unified-runtime-level-zero-write

# CUDA and HIP adapters
source/adapters/cuda @oneapi-src/unified-runtime-cuda-write
source/adapters/hip @oneapi-src/unified-runtime-hip-write
14 changes: 6 additions & 8 deletions source/adapters/level_zero/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,12 @@ ur_result_t ur_context_handle_t_::finalize() {
for (auto &List : ZeComputeCommandListCache) {
for (auto &Item : List.second) {
ze_command_list_handle_t ZeCommandList = Item.first;
if (ZeCommandList)
if (ZeCommandList) {
auto ZeResult =
ZE_CALL_NOCHECK(zeCommandListDestroy, (ZeCommandList));
// Gracefully handle the case that L0 was already unloaded.
if (ZeResult && ZeResult != ZE_RESULT_ERROR_UNINITIALIZED)
return ze2urResult(ZeResult);
}
if (ZeCommandList) {
auto ZeResult = ZE_CALL_NOCHECK(zeCommandListDestroy, (ZeCommandList));
// Gracefully handle the case that L0 was already unloaded.
if (ZeResult && ZeResult != ZE_RESULT_ERROR_UNINITIALIZED)
return ze2urResult(ZeResult);
}
}
}
for (auto &List : ZeCopyCommandListCache) {
Expand Down
1 change: 0 additions & 1 deletion source/adapters/level_zero/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(
}
}
return ReturnValue(Result);
return UR_RESULT_SUCCESS;
}
case UR_EVENT_INFO_REFERENCE_COUNT: {
return ReturnValue(Event->RefCount.load());
Expand Down
16 changes: 6 additions & 10 deletions source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
UR_RESULT_ERROR_INVALID_VALUE);

USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, Device,
*ResultPtr, Size);
return UR_RESULT_SUCCESS;
return USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context,
Device, *ResultPtr, Size);
}

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

USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, Device,
*ResultPtr, Size);

// TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY.
return UR_RESULT_SUCCESS;
return USMAllocationMakeResident(USMSharedAllocationForceResidency, Context,
Device, *ResultPtr, Size);
}

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

USMAllocationMakeResident(USMHostAllocationForceResidency, Context, nullptr,
*ResultPtr, Size);
return UR_RESULT_SUCCESS;
return USMAllocationMakeResident(USMHostAllocationForceResidency, Context,
nullptr, *ResultPtr, Size);
}

UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(
Expand Down

0 comments on commit 496d694

Please sign in to comment.