Skip to content

Commit

Permalink
Add TODO for handling other error results
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Aziz <michael.aziz@intel.com>
  • Loading branch information
0x12CC committed Nov 2, 2023
1 parent bc7c0f4 commit fe469d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ static ur_result_t USMDeviceAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
UR_RESULT_ERROR_INVALID_VALUE);

// TODO: Return any non-success result from USMAllocationMakeResident once
// oneapi-src/level-zero-spec#240 is resolved.
auto Result = USMAllocationMakeResident(USMDeviceAllocationForceResidency,
Context, Device, *ResultPtr, Size);
if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY ||
Expand Down Expand Up @@ -229,6 +231,8 @@ static ur_result_t USMSharedAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
UR_RESULT_ERROR_INVALID_VALUE);

// TODO: Return any non-success result from USMAllocationMakeResident once
// oneapi-src/level-zero-spec#240 is resolved.
auto Result = USMAllocationMakeResident(USMSharedAllocationForceResidency,
Context, Device, *ResultPtr, Size);
if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY ||
Expand All @@ -255,6 +259,8 @@ static ur_result_t USMHostAllocImpl(void **ResultPtr,
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
UR_RESULT_ERROR_INVALID_VALUE);

// TODO: Return any non-success result from USMAllocationMakeResident once
// oneapi-src/level-zero-spec#240 is resolved.
auto Result = USMAllocationMakeResident(USMHostAllocationForceResidency,
Context, nullptr, *ResultPtr, Size);
if (Result == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY ||
Expand Down

0 comments on commit fe469d7

Please sign in to comment.