Fix calculations for offseted addresses

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-12-08 14:03:23 +00:00
committed by Compute-Runtime-Automation
parent 798256ed61
commit b32b5784c2
14 changed files with 346 additions and 169 deletions

View File

@@ -88,7 +88,11 @@ ze_result_t ContextImp::freeMem(const void *ptr) {
ze_result_t ContextImp::makeMemoryResident(ze_device_handle_t hDevice, void *ptr, size_t size) {
Device *device = L0::Device::fromHandle(hDevice);
NEO::Device *neoDevice = device->getNEODevice();
auto allocation = device->getDriverHandle()->getDriverSystemMemoryAllocation(ptr, size, neoDevice->getRootDeviceIndex());
auto allocation = device->getDriverHandle()->getDriverSystemMemoryAllocation(
ptr,
size,
neoDevice->getRootDeviceIndex(),
nullptr);
if (allocation == nullptr) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
@@ -112,7 +116,11 @@ ze_result_t ContextImp::makeMemoryResident(ze_device_handle_t hDevice, void *ptr
ze_result_t ContextImp::evictMemory(ze_device_handle_t hDevice, void *ptr, size_t size) {
Device *device = L0::Device::fromHandle(hDevice);
NEO::Device *neoDevice = device->getNEODevice();
auto allocation = device->getDriverHandle()->getDriverSystemMemoryAllocation(ptr, size, neoDevice->getRootDeviceIndex());
auto allocation = device->getDriverHandle()->getDriverSystemMemoryAllocation(
ptr,
size,
neoDevice->getRootDeviceIndex(),
nullptr);
if (allocation == nullptr) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}