Skip to content

Commit

Permalink
Merge pull request #972 from oneapi-src/revert-906-l0_usm_error_checking
Browse files Browse the repository at this point in the history
Revert "[UR][L0] Propagate errors from `USMAllocationMakeResident`"
  • Loading branch information
kbenzie authored Oct 20, 2023
2 parents 3653e58 + 657ffde commit a76e3b1
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 a76e3b1

Please sign in to comment.