feature: initial support for standalone CB Events Timestamps allocator

Related-To: NEO-11925

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-07-19 15:15:04 +00:00
committed by Compute-Runtime-Automation
parent 4513e42ddb
commit 3758e99cbf
18 changed files with 245 additions and 2 deletions

View File

@@ -620,4 +620,5 @@ ForceScratchAndMTPBufferSizeMode = -1
ForcePostSyncL1Flush = -1
AllowNotZeroForCompressedOnWddm = -1
ForceGmmSystemMemoryBufferForAllocations = 0
StandaloneInOrderTimestampAllocationEnabled = -1
# Please don't edit below this line

View File

@@ -74,6 +74,72 @@ HWTEST_F(CommandEncoderTests, givenDifferentInputParamsWhenCreatingStandaloneInO
EXPECT_EQ(0u, inOrderExecInfo->getCounterValue());
}
HWTEST_F(CommandEncoderTests, givenTsNodesWhenStoringOnTempListThenHandleOwnershipCorrectly) {
class MyMockInOrderExecInfo : public NEO::InOrderExecInfo {
public:
using InOrderExecInfo::InOrderExecInfo;
using InOrderExecInfo::lastWaitedCounterValue;
using InOrderExecInfo::tempTimestampNodes;
};
MockDevice mockDevice;
using AllocatorT = MockTagAllocator<NEO::TimestampPackets<uint64_t, 1>>;
AllocatorT tsAllocator(0, mockDevice.getMemoryManager());
auto &memoryManager = *mockDevice.getMemoryManager();
auto node0 = static_cast<AllocatorT::NodeType *>(tsAllocator.getTag());
auto node1 = static_cast<AllocatorT::NodeType *>(tsAllocator.getTag());
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node1));
{
MyMockInOrderExecInfo inOrderExecInfo(nullptr, nullptr, memoryManager, 1, 0, false, false);
inOrderExecInfo.lastWaitedCounterValue = 0;
inOrderExecInfo.pushTempTimestampNode(node0, 1);
inOrderExecInfo.pushTempTimestampNode(node1, 2);
EXPECT_EQ(2u, inOrderExecInfo.tempTimestampNodes.size());
inOrderExecInfo.releaseNotUsedTempTimestampNodes(false);
EXPECT_EQ(2u, inOrderExecInfo.tempTimestampNodes.size());
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node1));
inOrderExecInfo.lastWaitedCounterValue = 1;
inOrderExecInfo.releaseNotUsedTempTimestampNodes(false);
EXPECT_EQ(1u, inOrderExecInfo.tempTimestampNodes.size());
EXPECT_EQ(node1, inOrderExecInfo.tempTimestampNodes[0].first);
EXPECT_TRUE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node1));
inOrderExecInfo.lastWaitedCounterValue = 2;
inOrderExecInfo.releaseNotUsedTempTimestampNodes(false);
EXPECT_EQ(0u, inOrderExecInfo.tempTimestampNodes.size());
EXPECT_TRUE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_TRUE(tsAllocator.freeTags.peekContains(*node1));
node0 = static_cast<AllocatorT::NodeType *>(tsAllocator.getTag());
node1 = static_cast<AllocatorT::NodeType *>(tsAllocator.getTag());
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_FALSE(tsAllocator.freeTags.peekContains(*node1));
inOrderExecInfo.pushTempTimestampNode(node0, 3);
inOrderExecInfo.pushTempTimestampNode(node1, 4);
}
// forced release on destruction
EXPECT_TRUE(tsAllocator.freeTags.peekContains(*node0));
EXPECT_TRUE(tsAllocator.freeTags.peekContains(*node1));
}
HWTEST_F(CommandEncoderTests, givenDifferentInputParamsWhenCreatingInOrderExecInfoThenSetupCorrectly) {
MockDevice mockDevice;