Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[UR][L0] Propagate errors from USMAllocationMakeResident" #972

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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