mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
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:
committed by
Compute-Runtime-Automation
parent
e082b80e0a
commit
dc1fe7d59a
@@ -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>;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user