refactor: get ioh alignment from static function

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2024-07-24 11:27:35 +00:00
committed by Compute-Runtime-Automation
parent 1d3d3e9a79
commit afee8814ef
22 changed files with 65 additions and 52 deletions

View File

@@ -90,6 +90,7 @@ using IsAtMostPVC = IsAtMostProduct<IGFX_PVC>;
using IsNotPVC = IsNotWithinProducts<IGFX_PVC, IGFX_PVC>;
using IsNotPvcOrDg2 = IsNotWithinProducts<IGFX_DG2, IGFX_PVC>;
using IsAtMostArl = IsAtMostProduct<IGFX_ARROWLAKE>;
using IsAtLeastBmg = IsAtLeastProduct<IGFX_BMG>;
using HasStatefulSupport = IsNotAnyGfxCores<IGFX_XE_HPC_CORE>;

View File

@@ -1629,3 +1629,17 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenEncodeDispatchKernelWh
EXPECT_EQ(0u, EncodeDispatchKernel<FamilyType>::getInlineDataOffset(dispatchArgs));
}
HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenGetIohAlignemntThenOneReturned, IsAtMostArl) {
EXPECT_EQ(NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment(), 1u);
}
HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenGetIohAlignemntThenCacheLineSizeReturned, IsAtLeastBmg) {
EXPECT_EQ(NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment(), FamilyType::cacheLineSize);
}
HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenForcingDifferentIohAlignemntThenExpectedAlignmentReturned, IsAtLeastBmg) {
DebugManagerStateRestore restorer;
auto expectedAlignemnt = 1024u;
debugManager.flags.ForceIOHAlignment.set(expectedAlignemnt);
EXPECT_EQ(NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment(), expectedAlignemnt);
}

View File

@@ -595,7 +595,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenInlineDataRequiredWhe
size_t expectedSizeIOH = alignUp(dispatchInterface->getCrossThreadDataSize() +
dispatchInterface->getPerThreadDataSizeForWholeThreadGroup() -
inlineDataSize,
this->getHelper<GfxCoreHelper>().getIOHAlignment());
NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment());
auto heap = cmdContainer->getIndirectHeap(HeapType::indirectObject);
EXPECT_EQ(expectedSizeIOH, heap->getUsed());
}
@@ -622,7 +622,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenInlineDataRequiredIsF
size_t expectedSizeIOH = alignUp(dispatchInterface->getCrossThreadDataSize() +
dispatchInterface->getPerThreadDataSizeForWholeThreadGroup(),
this->getHelper<GfxCoreHelper>().getIOHAlignment());
NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment());
auto heap = cmdContainer->getIndirectHeap(HeapType::indirectObject);
EXPECT_EQ(expectedSizeIOH, heap->getUsed());
}
@@ -1613,6 +1613,6 @@ HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenRequestingExtraP
auto heap = cmdContainer->getIndirectHeap(HeapType::indirectObject);
size_t expectedConsumedSize = 64 + 1024;
expectedConsumedSize = alignUp(expectedConsumedSize, pDevice->getGfxCoreHelper().getIOHAlignment());
expectedConsumedSize = alignUp(expectedConsumedSize, NEO::EncodeDispatchKernel<FamilyType>::getDefaultIOHAlignment());
EXPECT_EQ(expectedConsumedSize, heap->getUsed());
}

View File

@@ -25,21 +25,6 @@ HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenCallIsTimestampSh
EXPECT_FALSE(gfxCoreHelper.isTimestampShiftRequired());
}
HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenGetIOHAlignmentThenReturnsCorrectValue, IsAtLeastXe2HpgCore) {
MockExecutionEnvironment mockExecutionEnvironment{};
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
EXPECT_EQ(gfxCoreHelper.getIOHAlignment(), 256u);
}
HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgAndForceIOHAlignmentFlagWhenGetIOHAlignmentThenReturnsCorrectValue, IsAtLeastXe2HpgCore) {
DebugManagerStateRestore restorer;
debugManager.flags.ForceIOHAlignment.set(1024);
MockExecutionEnvironment mockExecutionEnvironment{};
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
EXPECT_EQ(gfxCoreHelper.getIOHAlignment(), 1024u);
}
HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenDebugFlagWhenCheckingIsResolveDependenciesByPipeControlsSupportedThenCorrectValueIsReturned, IsLNL) {
DebugManagerStateRestore restorer;