Skip to content

Commit

Permalink
Revert "Merge pull request oneapi-src#1022 from 0x12CC/l0_usm_error_c…
Browse files Browse the repository at this point in the history
…hecking_2"

This reverts commit ec7982b, reversing
changes made to 62e6d2f.
  • Loading branch information
kbenzie committed Nov 9, 2023
1 parent 63f48aa commit 8a59336
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions source/adapters/level_zero/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +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 ||
Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) {
return Result;
}
USMAllocationMakeResident(USMDeviceAllocationForceResidency, Context, Device,
*ResultPtr, Size);
return UR_RESULT_SUCCESS;
}

Expand Down Expand Up @@ -231,14 +225,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 ||
Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) {
return Result;
}
USMAllocationMakeResident(USMSharedAllocationForceResidency, Context, Device,
*ResultPtr, Size);

// TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY.
return UR_RESULT_SUCCESS;
Expand All @@ -259,14 +247,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 ||
Result == UR_RESULT_ERROR_OUT_OF_HOST_MEMORY) {
return Result;
}
USMAllocationMakeResident(USMHostAllocationForceResidency, Context, nullptr,
*ResultPtr, Size);
return UR_RESULT_SUCCESS;
}

Expand Down

0 comments on commit 8a59336

Please sign in to comment.