fix: write memory for resident allocations in simulation mode

- refactor and call proceesFlushResdiency() on memoryOperationsHandler
- call free() to remove allocation from resident allocations when
graphics allocation is released

Related-To: NEO-11719

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-06-14 14:15:14 +00:00
committed by Compute-Runtime-Automation
parent 9954002db1
commit b3d72ddd3d
15 changed files with 285 additions and 73 deletions

View File

@@ -102,9 +102,23 @@ class MockMemoryOperations : public MemoryOperationsHandler {
return MemoryOperationsStatus::success;
}
MemoryOperationsStatus free(Device *device, GraphicsAllocation &gfxAllocation) override {
freeCalledCount++;
if (captureGfxAllocationsForMakeResident) {
auto itor = std::find(gfxAllocationsForMakeResident.begin(), gfxAllocationsForMakeResident.end(), &gfxAllocation);
if (itor != gfxAllocationsForMakeResident.end()) {
gfxAllocationsForMakeResident.erase(itor, itor + 1);
}
}
return MemoryOperationsStatus::success;
}
std::vector<GraphicsAllocation *> gfxAllocationsForMakeResident{};
int makeResidentCalledCount = 0;
int evictCalledCount = 0;
int freeCalledCount = 0;
uint32_t isResidentCalledCount = 0;
uint32_t lockCalledCount = 0;
uint32_t makeResidentContextId = std::numeric_limits<uint32_t>::max();