Change MemoryPool to enum class

Use enum class for MemoryPool in GraphicsAllocation
This change will ensure that GA is constructed in the proper way

- Rename namespace for isSystemMemoryPool method
- Add method getMemoryPoolString for logging actual pool which is in used
- Remove wrong pattern in GraphicsAllocation constructor

Related-To: NEO-6523
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-06-01 21:13:52 +00:00
committed by Compute-Runtime-Automation
parent e082b80e0a
commit dc1fe7d59a
47 changed files with 232 additions and 173 deletions

View File

@@ -95,7 +95,7 @@ void FileLogger<DebugLevel>::logAllocation(GraphicsAllocation const *graphicsAll
ss << " ThreadID: " << thisThread;
ss << " AllocationType: " << getAllocationTypeString(graphicsAllocation);
ss << " MemoryPool: " << graphicsAllocation->getMemoryPool();
ss << " MemoryPool: " << getMemoryPoolString(graphicsAllocation);
ss << " Root device index: " << graphicsAllocation->getRootDeviceIndex();
ss << " GPU address: 0x" << std::hex << graphicsAllocation->getGpuAddress() << " - 0x" << std::hex << graphicsAllocation->getGpuAddress() + graphicsAllocation->getUnderlyingBufferSize() - 1;
@@ -233,6 +233,30 @@ const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation
}
}
const char *getMemoryPoolString(GraphicsAllocation const *graphicsAllocation) {
auto pool = graphicsAllocation->getMemoryPool();
switch (pool) {
case MemoryPool::MemoryNull:
return "MemoryNull";
case MemoryPool::System4KBPages:
return "System4KBPages";
case MemoryPool::System64KBPages:
return "System64KBPages";
case MemoryPool::System4KBPagesWith32BitGpuAddressing:
return "System4KBPagesWith32BitGpuAddressing";
case MemoryPool::System64KBPagesWith32BitGpuAddressing:
return "System64KBPagesWith32BitGpuAddressing";
case MemoryPool::SystemCpuInaccessible:
return "SystemCpuInaccessible";
case MemoryPool::LocalMemory:
return "LocalMemory";
}
UNRECOVERABLE_IF(true);
return "ILLEGAL_VALUE";
}
template class FileLogger<DebugFunctionalityLevel::None>;
template class FileLogger<DebugFunctionalityLevel::RegKeys>;
template class FileLogger<DebugFunctionalityLevel::Full>;

View File

@@ -22,6 +22,7 @@ struct MultiDispatchInfo;
class GraphicsAllocation;
const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation);
const char *getMemoryPoolString(GraphicsAllocation const *graphicsAllocation);
template <DebugFunctionalityLevel DebugLevel>
class FileLogger {