refactor: Add helper to control flat ring buffer

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-03-07 16:30:14 +00:00
committed by Compute-Runtime-Automation
parent 277a0b9f1f
commit 6d1a3d404e
6 changed files with 18 additions and 6 deletions

View File

@@ -269,7 +269,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
this->csr &&
this->csr->isAnyDirectSubmissionEnabled() &&
!neoDevice->getExecutionEnvironment()->areMetricsEnabled() &&
neoDevice->getMemoryManager()->isLocalMemorySupported(neoDevice->getRootDeviceIndex());
neoDevice->getMemoryManager()->isLocalMemorySupported(neoDevice->getRootDeviceIndex()) &&
productHelper.isFlatRingBufferSupported();
if (NEO::debugManager.flags.DirectSubmissionFlatRingBuffer.get() != -1) {
createSecondaryCmdBufferInHostMem &= !!NEO::debugManager.flags.DirectSubmissionFlatRingBuffer.get();

View File

@@ -880,9 +880,9 @@ HWTEST_F(CommandListCreate, givenImmediateCopyOnlySingleTileDirectSubmissionComm
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
auto localMemSupported = device->getHwInfo().featureTable.flags.ftrLocalMemory;
EXPECT_EQ(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get() != nullptr, localMemSupported);
if (localMemSupported) {
auto flatRingSupported = device->getHwInfo().featureTable.flags.ftrLocalMemory && device->getProductHelper().isFlatRingBufferSupported();
EXPECT_EQ(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get() != nullptr, flatRingSupported);
if (flatRingSupported) {
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
}
}
@@ -905,7 +905,7 @@ HWTEST_F(CommandListCreate, givenMetricsImmediateCopyOnlySingleTileDirectSubmiss
}
HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenCheckAvailableSpaceThenSwapCommandStreams, IsAtLeastSkl) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory || !device->getProductHelper().isFlatRingBufferSupported()) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;
@@ -933,7 +933,7 @@ HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenC
}
HWTEST2_F(CommandListCreate, givenNoSecondaryCommandStreamForImmediateCmdListWhenCheckAvailableSpaceThenNotSwapCommandStreams, IsAtLeastSkl) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory || !device->getProductHelper().isFlatRingBufferSupported()) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;