refactor: move memory tracking to memory manager

- remove wddm specific code
- improve total size reported to be in decimal

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2024-09-12 15:38:44 +00:00
committed by Compute-Runtime-Automation
parent c0d9cb4d84
commit dd631610b3
7 changed files with 18 additions and 20 deletions

View File

@@ -955,16 +955,6 @@ double WddmMemoryManager::getPercentOfGlobalMemoryAvailable(uint32_t rootDeviceI
return 0.94;
}
AllocationStatus WddmMemoryManager::registerSysMemAlloc(GraphicsAllocation *allocation) {
this->sysMemAllocsSize += allocation->getUnderlyingBufferSize();
return AllocationStatus::Success;
}
AllocationStatus WddmMemoryManager::registerLocalMemAlloc(GraphicsAllocation *allocation, uint32_t rootDeviceIndex) {
this->localMemAllocsSize[rootDeviceIndex] += allocation->getUnderlyingBufferSize();
return AllocationStatus::Success;
}
AlignedMallocRestrictions *WddmMemoryManager::getAlignedMallocRestrictions() {
return &mallocRestrictions;
}

View File

@@ -50,8 +50,6 @@ class WddmMemoryManager : public MemoryManager {
uint64_t getSystemSharedMemory(uint32_t rootDeviceIndex) override;
uint64_t getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t deviceBitfield) override;
double getPercentOfGlobalMemoryAvailable(uint32_t rootDeviceIndex) override;
AllocationStatus registerSysMemAlloc(GraphicsAllocation *allocation) override;
AllocationStatus registerLocalMemAlloc(GraphicsAllocation *allocation, uint32_t rootDeviceIndex) override;
bool tryDeferDeletions(const D3DKMT_HANDLE *handles, uint32_t allocationCount, D3DKMT_HANDLE resourceHandle, uint32_t rootDeviceIndex);