|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | #include "shared/source/command_stream/preemption.h" |
| 9 | +#include "shared/source/debug_settings/debug_settings_manager.h" |
9 | 10 | #include "shared/source/gen_common/reg_configs/reg_configs_common.h" |
10 | 11 | #include "shared/source/helpers/flat_batch_buffer_helper_hw.h" |
11 | 12 | #include "shared/source/helpers/preamble.h" |
@@ -191,6 +192,28 @@ HWTEST_F(PreambleTest, givenDefaultPreambleWhenGetThreadsMaxNumberIsCalledThenMa |
191 | 192 | EXPECT_EQ(expected, value); |
192 | 193 | } |
193 | 194 |
|
| 195 | +HWTEST_F(PreambleTest, givenMaxHwThreadsPercentDebugVariableWhenGetThreadsMaxNumberIsCalledThenMaximumNumberOfThreadsIsCappedToRequestedNumber) { |
| 196 | + const HardwareInfo &hwInfo = *defaultHwInfo; |
| 197 | + uint32_t threadsPerEU = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU; |
| 198 | + DebugManagerStateRestore debugManagerStateRestore; |
| 199 | + DebugManager.flags.MaxHwThreadsPercent.set(80); |
| 200 | + uint32_t value = HwHelper::getMaxThreadsForVfe(hwInfo); |
| 201 | + |
| 202 | + uint32_t expected = int(hwInfo.gtSystemInfo.EUCount * threadsPerEU * 80 / 100.0f); |
| 203 | + EXPECT_EQ(expected, value); |
| 204 | +} |
| 205 | + |
| 206 | +HWTEST_F(PreambleTest, givenMinHwThreadsUnoccupiedDebugVariableWhenGetThreadsMaxNumberIsCalledThenMaximumNumberOfThreadsIsCappedToMatchRequestedNumber) { |
| 207 | + const HardwareInfo &hwInfo = *defaultHwInfo; |
| 208 | + uint32_t threadsPerEU = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU; |
| 209 | + DebugManagerStateRestore debugManagerStateRestore; |
| 210 | + DebugManager.flags.MinHwThreadsUnoccupied.set(2); |
| 211 | + uint32_t value = HwHelper::getMaxThreadsForVfe(hwInfo); |
| 212 | + |
| 213 | + uint32_t expected = hwInfo.gtSystemInfo.EUCount * threadsPerEU - 2; |
| 214 | + EXPECT_EQ(expected, value); |
| 215 | +} |
| 216 | + |
194 | 217 | HWCMDTEST_F(IGFX_GEN8_CORE, PreambleTest, givenPreambleHelperWhenMediaVfeStateIsProgrammedThenOffsetToCommandIsReturned) { |
195 | 218 | char buffer[64]; |
196 | 219 | MockGraphicsAllocation graphicsAllocation(buffer, sizeof(buffer)); |
|
0 commit comments