Skip to content

Commit

Permalink
Revert "[UR][L0] Propagate errors from USMAllocationMakeResident"
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenzie committed Oct 19, 2023
1 parent 3653e58 commit 657ffde
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*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,
Expand Down Expand Up @@ -224,9 +225,11 @@ 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 USMAllocationMakeResident(USMSharedAllocationForceResidency, Context,
Device, *ResultPtr, Size);
return UR_RESULT_SUCCESS;
}

static ur_result_t USMHostAllocImpl(void **ResultPtr,
Expand All @@ -244,8 +247,9 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*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(
Expand Down

0 comments on commit 657ffde

Please sign in to comment.