Log root device index when logging allocations

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2021-03-18 11:34:13 +00:00 committed by Compute-Runtime-Automation
parent 120b3244dc
commit 5de0a7140a
3 changed files with 9 additions and 0 deletions

View File

@ -97,6 +97,7 @@ void FileLogger<DebugLevel>::logAllocation(GraphicsAllocation const *graphicsAll
ss << " ThreadID: " << thisThread;
ss << " AllocationType: " << getAllocationTypeString(graphicsAllocation);
ss << " MemoryPool: " << graphicsAllocation->getMemoryPool();
ss << " Root device index: " << graphicsAllocation->getRootDeviceIndex();
ss << " GPU address: 0x" << std::hex << graphicsAllocation->getGpuAddress();
ss << graphicsAllocation->getAllocationInfoString();
ss << std::endl;

View File

@ -49,11 +49,15 @@ TEST(FileLogger, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
std::stringstream gpuAddressCheck;
gpuAddressCheck << " GPU address: 0x" << std::hex << allocation.getGpuAddress();
std::stringstream rootDeviceIndexCheck;
rootDeviceIndexCheck << " Root device index: " << allocation.getRootDeviceIndex();
if (fileLogger.wasFileCreated(fileLogger.getLogFileName())) {
auto str = fileLogger.getFileString(fileLogger.getLogFileName());
EXPECT_TRUE(str.find(threadIDCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(memoryPoolCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(gpuAddressCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(rootDeviceIndexCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find("AllocationType: BUFFER") != std::string::npos);
EXPECT_TRUE(str.find("Handle: 4") != std::string::npos);
}

View File

@ -48,12 +48,16 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
std::stringstream gpuAddressCheck;
gpuAddressCheck << " GPU address: 0x" << std::hex << allocation.getGpuAddress();
std::stringstream rootDeviceIndexCheck;
rootDeviceIndexCheck << " Root device index: " << allocation.getRootDeviceIndex();
if (fileLogger.wasFileCreated(fileLogger.getLogFileName())) {
auto str = fileLogger.getFileString(fileLogger.getLogFileName());
EXPECT_TRUE(str.find(threadIDCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find("Handle: 4") != std::string::npos);
EXPECT_TRUE(str.find(memoryPoolCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(gpuAddressCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find(rootDeviceIndexCheck.str()) != std::string::npos);
EXPECT_TRUE(str.find("AllocationType: BUFFER") != std::string::npos);
}
}