Improve PrintDeviceAndEngineIdOnSubmission flag

Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-06-22 16:07:47 +00:00
committed by Compute-Runtime-Automation
parent 96d14967ac
commit 7979dcb757
4 changed files with 20 additions and 3 deletions

View File

@@ -199,8 +199,13 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPrintIndicesEnabledWhenFlushThenPr
::testing::internal::CaptureStdout();
csr->flush(batchBuffer, csr->getResidencyAllocations());
const std::string engineType = EngineHelpers::engineTypeToString(csr->getOsContext().getEngineType());
const std::string engineUsage = EngineHelpers::engineUsageToString(csr->getOsContext().getEngineUsage());
std::ostringstream expectedValue;
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex() << ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong() << ", EngineId: " << csr->getOsContext().getEngineType() << "\n";
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex()
<< ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong()
<< ", EngineId: " << csr->getOsContext().getEngineType()
<< " (" << engineType << ", " << engineUsage << ")\n";
EXPECT_THAT(::testing::internal::GetCapturedStdout(), ::testing::HasSubstr(expectedValue.str()));
}

View File

@@ -236,8 +236,14 @@ TEST_F(WddmCommandStreamTest, givenPrintIndicesEnabledWhenFlushThenPrintIndices)
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false};
::testing::internal::CaptureStdout();
csr->flush(batchBuffer, csr->getResidencyAllocations());
const std::string engineType = EngineHelpers::engineTypeToString(csr->getOsContext().getEngineType());
const std::string engineUsage = EngineHelpers::engineUsageToString(csr->getOsContext().getEngineUsage());
std::ostringstream expectedValue;
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex() << ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong() << ", EngineId: " << csr->getOsContext().getEngineType() << "\n";
expectedValue << "Submission to RootDevice Index: " << csr->getRootDeviceIndex()
<< ", Sub-Devices Mask: " << csr->getOsContext().getDeviceBitfield().to_ulong()
<< ", EngineId: " << csr->getOsContext().getEngineType()
<< " (" << engineType << ", " << engineUsage << ")\n";
EXPECT_STREQ(::testing::internal::GetCapturedStdout().c_str(), expectedValue.str().c_str());
memoryManager->freeGraphicsMemory(commandBuffer);