mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
test: improve HWTEST2_F macro
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
bb36614567
commit
ab7364ae19
@@ -343,7 +343,7 @@ HWTEST2_P(LargeGrfTest, givenLargeGrfKernelWhenExecutedThenResultsAreCorrect, Is
|
||||
auto largeGrfValues = NEO::UnitTestHelper<FamilyType>::getProgrammedLargeGrfValues(pCmdQ->getGpgpuCommandStreamReceiver(),
|
||||
pCmdQ->getCS(0));
|
||||
EXPECT_EQ(largeGrfValues.size(), 1u);
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
EXPECT_TRUE(largeGrfValues[0]);
|
||||
} else {
|
||||
EXPECT_FALSE(largeGrfValues[0]);
|
||||
@@ -382,7 +382,7 @@ HWTEST2_P(LargeGrfTest, givenKernelWithSpillWhenExecutedInLargeGrfThenDontSpillA
|
||||
auto largeGrfValues = NEO::UnitTestHelper<FamilyType>::getProgrammedLargeGrfValues(pCmdQ->getGpgpuCommandStreamReceiver(),
|
||||
pCmdQ->getCS(0));
|
||||
EXPECT_EQ(largeGrfValues.size(), 1u);
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
EXPECT_TRUE(largeGrfValues[0]);
|
||||
} else {
|
||||
EXPECT_FALSE(largeGrfValues[0]);
|
||||
@@ -440,7 +440,7 @@ HWTEST2_P(LargeGrfTest, givenMixedLargeGrfAndSmallGrfKernelsWhenExecutedThenResu
|
||||
auto largeGrfValues = NEO::UnitTestHelper<FamilyType>::getProgrammedLargeGrfValues(pCmdQ->getGpgpuCommandStreamReceiver(),
|
||||
pCmdQ->getCS(0));
|
||||
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
auto allocation = smallGrfSourceBuffer->getGraphicsAllocation(rootDeviceIndex);
|
||||
auto &productHelper = pCmdQ->getDevice().getProductHelper();
|
||||
if (allocation->isAllocatedInLocalMemoryPool() && productHelper.isGrfNumReportedWithScm()) {
|
||||
|
||||
@@ -516,7 +516,7 @@ HWTEST2_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBD
|
||||
PatchInfoData patchInfoData = {0xaaaaaaaa, 0, PatchInfoAllocationType::kernelArg, 0xbbbbbbbb, 0, PatchInfoAllocationType::indirectObjectHeap};
|
||||
mockKernel.mockKernel->getPatchInfoDataList().push_back(patchInfoData);
|
||||
|
||||
uint32_t expectedCallsCount = TestTraits<gfxCoreFamily>::iohInSbaSupported ? 8 : 7;
|
||||
uint32_t expectedCallsCount = TestTraits<FamilyType::gfxCoreFamily>::iohInSbaSupported ? 8 : 7;
|
||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) {
|
||||
--expectedCallsCount;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -77,7 +77,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests,
|
||||
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
||||
dispatchFlags.outOfOrderExecutionAllowed = true;
|
||||
|
||||
uint32_t expectedCallsCount = TestTraits<gfxCoreFamily>::iohInSbaSupported ? 10 : 9;
|
||||
uint32_t expectedCallsCount = TestTraits<FamilyType::gfxCoreFamily>::iohInSbaSupported ? 10 : 9;
|
||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) {
|
||||
--expectedCallsCount;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhen
|
||||
|
||||
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
||||
|
||||
uint32_t expectedCallsCount = TestTraits<gfxCoreFamily>::iohInSbaSupported ? 4 : 3;
|
||||
uint32_t expectedCallsCount = TestTraits<FamilyType::gfxCoreFamily>::iohInSbaSupported ? 4 : 3;
|
||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) {
|
||||
--expectedCallsCount;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectState
|
||||
auto mockHelper = new MockFlatBatchBufferHelper<FamilyType>(*pDevice->executionEnvironment);
|
||||
mockCsr->overwriteFlatBatchBufferHelper(mockHelper);
|
||||
|
||||
uint32_t expectedCallsCount = TestTraits<gfxCoreFamily>::iohInSbaSupported ? 4 : 3;
|
||||
uint32_t expectedCallsCount = TestTraits<FamilyType::gfxCoreFamily>::iohInSbaSupported ? 4 : 3;
|
||||
auto dshPatchIndex = 0u;
|
||||
auto gshPatchIndex = 1u;
|
||||
auto sshPatchIndex = 2u;
|
||||
@@ -248,7 +248,7 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectState
|
||||
EXPECT_EQ(dshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET);
|
||||
}
|
||||
|
||||
if constexpr (TestTraits<gfxCoreFamily>::iohInSbaSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::iohInSbaSupported) {
|
||||
// IOH
|
||||
PatchInfoData iohPatch = mockHelper->patchInfoDataVector[iohPatchIndex];
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ HWTEST2_F(PreambleCfeStateXe3AndLater, givenSetDebugFlagWhenPreambleCfeStateIsPr
|
||||
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
|
||||
|
||||
EXPECT_EQ(expectedValue1, static_cast<uint32_t>(cfeState->getOverDispatchControl()));
|
||||
if constexpr (TestTraits<gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
EXPECT_EQ(expectedValue2, cfeState->getNumberOfWalkers());
|
||||
}
|
||||
EXPECT_EQ(expectedValue2, cfeState->getMaximumNumberOfThreads());
|
||||
|
||||
@@ -156,10 +156,10 @@ HWTEST2_F(PreambleCfeStateXeHPAndLater, givenNotSetDebugFlagWhenPreambleCfeState
|
||||
|
||||
[[maybe_unused]] uint32_t numberOfWalkers = 0u;
|
||||
[[maybe_unused]] uint32_t fusedEuDispach = 0u;
|
||||
if constexpr (TestTraits<gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
numberOfWalkers = cfeState->getNumberOfWalkers();
|
||||
}
|
||||
if constexpr (TestTraits<gfxCoreFamily>::fusedEuDispatchSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::fusedEuDispatchSupported) {
|
||||
fusedEuDispach = cfeState->getFusedEuDispatch();
|
||||
}
|
||||
uint32_t overDispatchControl = static_cast<uint32_t>(cfeState->getOverDispatchControl());
|
||||
@@ -171,10 +171,10 @@ HWTEST2_F(PreambleCfeStateXeHPAndLater, givenNotSetDebugFlagWhenPreambleCfeState
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, pDevice->getRootDeviceEnvironment(), 0u, expectedAddress, expectedMaxThreads, emptyProperties);
|
||||
uint32_t maximumNumberOfThreads = cfeState->getMaximumNumberOfThreads();
|
||||
|
||||
if constexpr (TestTraits<gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
EXPECT_EQ(numberOfWalkers, cfeState->getNumberOfWalkers());
|
||||
}
|
||||
if constexpr (TestTraits<gfxCoreFamily>::fusedEuDispatchSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::fusedEuDispatchSupported) {
|
||||
EXPECT_EQ(fusedEuDispach, cfeState->getFusedEuDispatch());
|
||||
}
|
||||
EXPECT_NE(expectedMaxThreads, maximumNumberOfThreads);
|
||||
@@ -209,7 +209,7 @@ HWTEST2_F(PreambleCfeStateXeHPAndLater, givenSetDebugFlagWhenPreambleCfeStateIsP
|
||||
|
||||
EXPECT_EQ(expectedValue1, static_cast<uint32_t>(cfeState->getOverDispatchControl()));
|
||||
EXPECT_EQ(expectedValue1, cfeState->getLargeGRFThreadAdjustDisable());
|
||||
if constexpr (TestTraits<gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
if constexpr (TestTraits<FamilyType::gfxCoreFamily>::numberOfWalkersInCfeStateSupported) {
|
||||
EXPECT_EQ(expectedValue2, cfeState->getNumberOfWalkers());
|
||||
}
|
||||
EXPECT_EQ(expectedValue2, cfeState->getMaximumNumberOfThreads());
|
||||
|
||||
Reference in New Issue
Block a user