Add alternative residency model on Linux

Related-To: NEO-4732

Change-Id: I79e165d2b647af200ca314e1183ecf05903de644
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-07-02 11:49:46 +02:00
parent 519e75e3d6
commit ff0add74e3
50 changed files with 521 additions and 272 deletions

View File

@@ -181,7 +181,7 @@ ze_result_t DeviceImp::createModule(const ze_module_desc_t *desc, ze_module_hand
ze_result_t DeviceImp::evictImage(ze_image_handle_t hImage) {
auto alloc = Image::fromHandle(hImage)->getAllocation();
NEO::MemoryOperationsHandler *memoryOperationsIface = neoDevice->getRootDeviceEnvironment().memoryOperationsInterface.get();
auto success = memoryOperationsIface->evict(*alloc);
auto success = memoryOperationsIface->evict(neoDevice, *alloc);
return changeMemoryOperationStatusToL0ResultType(success);
}
@@ -191,7 +191,7 @@ ze_result_t DeviceImp::evictMemory(void *ptr, size_t size) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
NEO::MemoryOperationsHandler *memoryOperationsIface = neoDevice->getRootDeviceEnvironment().memoryOperationsInterface.get();
auto success = memoryOperationsIface->evict(*alloc->gpuAllocations.getGraphicsAllocation(getRootDeviceIndex()));
auto success = memoryOperationsIface->evict(neoDevice, *alloc->gpuAllocations.getGraphicsAllocation(getRootDeviceIndex()));
return changeMemoryOperationStatusToL0ResultType(success);
}
@@ -399,7 +399,7 @@ ze_result_t DeviceImp::getSubDevices(uint32_t *pCount, ze_device_handle_t *phSub
ze_result_t DeviceImp::makeImageResident(ze_image_handle_t hImage) {
auto alloc = Image::fromHandle(hImage)->getAllocation();
NEO::MemoryOperationsHandler *memoryOperationsIface = neoDevice->getRootDeviceEnvironment().memoryOperationsInterface.get();
auto success = memoryOperationsIface->makeResident(ArrayRef<NEO::GraphicsAllocation *>(&alloc, 1));
auto success = memoryOperationsIface->makeResident(neoDevice, ArrayRef<NEO::GraphicsAllocation *>(&alloc, 1));
return changeMemoryOperationStatusToL0ResultType(success);
}
@@ -410,7 +410,7 @@ ze_result_t DeviceImp::makeMemoryResident(void *ptr, size_t size) {
}
NEO::MemoryOperationsHandler *memoryOperationsIface = neoDevice->getRootDeviceEnvironment().memoryOperationsInterface.get();
auto gpuAllocation = alloc->gpuAllocations.getGraphicsAllocation(getRootDeviceIndex());
auto success = memoryOperationsIface->makeResident(ArrayRef<NEO::GraphicsAllocation *>(&gpuAllocation, 1));
auto success = memoryOperationsIface->makeResident(neoDevice, ArrayRef<NEO::GraphicsAllocation *>(&gpuAllocation, 1));
return changeMemoryOperationStatusToL0ResultType(success);
}

View File

@@ -214,7 +214,7 @@ void EventImp::makeAllocationResident() {
if (memoryOperationsIface) {
auto alloc = &(this->eventPool->getAllocation());
memoryOperationsIface->makeResident(ArrayRef<NEO::GraphicsAllocation *>(&alloc, 1));
memoryOperationsIface->makeResident(deviceImp->neoDevice, ArrayRef<NEO::GraphicsAllocation *>(&alloc, 1));
}
}