feature: dont initialize in-order TS nodes

Related-To: NEO-11925

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-07-22 15:46:14 +00:00
committed by Compute-Runtime-Automation
parent 8f4472a26c
commit c3312f21f7
9 changed files with 85 additions and 20 deletions

View File

@@ -39,7 +39,7 @@ NEO::TagAllocatorBase *getInOrderCounterAllocator(std::unique_ptr<NEO::TagAlloca
DEBUG_BREAK_IF(alignUp(nodeSize, MemoryConstants::cacheLineSize) * NodeT::defaultAllocatorTagCount > MemoryConstants::pageSize64k);
allocator = std::make_unique<NEO::TagAllocator<NodeT>>(rootDeviceIndices, neoDevice.getMemoryManager(), NodeT::defaultAllocatorTagCount,
MemoryConstants::cacheLineSize, nodeSize, false, neoDevice.getDeviceBitfield());
MemoryConstants::cacheLineSize, nodeSize, false, true, neoDevice.getDeviceBitfield());
}
}

View File

@@ -76,7 +76,7 @@ std::unique_ptr<NEO::TagAllocatorBase> L0GfxCoreHelperHw<Family>::getInOrderTime
size_t size = sizeof(TimestampPacketsT) * packetsCountPerElement;
return std::make_unique<NEO::TagAllocator<TimestampPacketsT>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, size, false, deviceBitfield);
return std::make_unique<NEO::TagAllocator<TimestampPacketsT>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, size, false, false, deviceBitfield);
}
} // namespace L0

View File

@@ -923,6 +923,40 @@ TEST_F(DeviceTest, whenCreatingDeviceThenCreateInOrderCounterAllocatorOnDemandAn
}
}
HWTEST_F(DeviceTest, givenTsAllocatorWhenGettingNewTagThenDontInitialize) {
using TimestampPacketType = typename FamilyType::TimestampPacketType;
using TimestampPacketsT = NEO::TimestampPackets<TimestampPacketType, 1>;
auto executionEnvironment = NEO::MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0);
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
auto *neoMockDevice = new NEO::MockDevice(executionEnvironment, rootDeviceIndex);
neoMockDevice->createDeviceImpl();
MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
auto allocator = deviceImp.getInOrderTimestampAllocator();
TimestampPacketType data[4] = {123, 456, 789, 987};
auto tag = static_cast<NEO::TagNode<TimestampPacketsT> *>(allocator->getTag());
tag->tagForCpuAccess->assignDataToAllTimestamps(0, data);
EXPECT_EQ(data[0], tag->tagForCpuAccess->getContextStartValue(0));
EXPECT_EQ(data[1], tag->tagForCpuAccess->getGlobalStartValue(0));
EXPECT_EQ(data[2], tag->tagForCpuAccess->getContextEndValue(0));
EXPECT_EQ(data[3], tag->tagForCpuAccess->getGlobalEndValue(0));
tag->returnTag();
auto tag2 = static_cast<NEO::TagNode<TimestampPacketsT> *>(allocator->getTag());
EXPECT_EQ(tag, tag2);
EXPECT_EQ(data[0], tag->tagForCpuAccess->getContextStartValue(0));
EXPECT_EQ(data[1], tag->tagForCpuAccess->getGlobalStartValue(0));
EXPECT_EQ(data[2], tag->tagForCpuAccess->getContextEndValue(0));
EXPECT_EQ(data[3], tag->tagForCpuAccess->getGlobalEndValue(0));
}
TEST_F(DeviceTest, givenMoreThanOneExtendedPropertiesStructuresWhenKernelPropertiesCalledThenSuccessIsReturnedAndPropertiesAreSet) {
ze_scheduling_hint_exp_properties_t schedulingHintProperties = {};
schedulingHintProperties.stype = ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES;