Disable overdispatch by default

When disable overdispatch is available:
- change default value of CFE_STATE::ComputeOverdispatchDisable to true.
- change default value of
INTERFACE_DESCRIPTOR_DATA::ThreadGroupDispatchSize to 3u.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2021-07-29 18:21:14 +00:00
committed by Compute-Runtime-Automation
parent d3fd5077e7
commit 2dd0e67e65
14 changed files with 116 additions and 56 deletions

View File

@ -5,8 +5,13 @@
*
*/
#include "shared/source/command_stream/scratch_space_controller.h"
#include "shared/source/command_stream/scratch_space_controller_base.h"
#include "shared/source/helpers/constants.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/mocks/ult_device_factory.h"
#include "shared/test/unit_test/utilities/base_object_utils.h"
#include "opencl/source/event/user_event.h"
@ -563,6 +568,46 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenForceEnableGpuIdleImplicitFlushThenExp
EXPECT_TRUE(commandStreamReceiver->useGpuIdleImplicitFlush);
}
HWTEST2_F(CommandStreamReceiverHwTest, whenProgramVFEStateIsCalledThenCorrectComputeOverdispatchDisableValueIsProgrammed, IsAtLeastXeHpCore) {
using CFE_STATE = typename FamilyType::CFE_STATE;
UltDeviceFactory deviceFactory{1, 0};
auto pDevice = deviceFactory.rootDevices[0];
auto pHwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily);
uint8_t memory[1 * KB];
auto mockCsr = std::make_unique<MockCsrHw2<FamilyType>>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(),
pDevice->getDeviceBitfield());
MockOsContext osContext{0, 8, EngineTypeUsage{aub_stream::ENGINE_CCS, EngineUsage::Regular}, PreemptionMode::Disabled, false};
mockCsr->setupContext(osContext);
uint32_t revisions[] = {REVISION_A0, REVISION_B};
for (auto revision : revisions) {
pHwInfo->platform.usRevId = hwHelper.getHwRevIdFromStepping(revision, *pHwInfo);
{
auto flags = DispatchFlagsHelper::createDefaultDispatchFlags();
LinearStream commandStream{&memory, sizeof(memory)};
mockCsr->mediaVfeStateDirty = true;
mockCsr->programVFEState(commandStream, flags, 10);
auto pCommand = reinterpret_cast<CFE_STATE *>(&memory);
auto expectedDisableOverdispatch = hwHelper.isDisableOverdispatchAvailable(*pHwInfo);
EXPECT_EQ(expectedDisableOverdispatch, pCommand->getComputeOverdispatchDisable());
}
{
auto flags = DispatchFlagsHelper::createDefaultDispatchFlags();
flags.additionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
LinearStream commandStream{&memory, sizeof(memory)};
mockCsr->mediaVfeStateDirty = true;
mockCsr->programVFEState(commandStream, flags, 10);
auto pCommand = reinterpret_cast<CFE_STATE *>(&memory);
EXPECT_FALSE(pCommand->getComputeOverdispatchDisable());
}
}
}
HWTEST_F(BcsTests, WhenGetNumberOfBlitsForCopyPerRowIsCalledThenCorrectValuesAreReturned) {
auto &rootDeviceEnvironment = pClDevice->getRootDeviceEnvironment();
auto maxWidthToCopy = static_cast<size_t>(BlitCommandsHelper<FamilyType>::getMaxBlitWidth(rootDeviceEnvironment));

View File

@ -1292,10 +1292,9 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenIsBlitterForImagesSupportedIsCalledThenF
EXPECT_FALSE(helper.isBlitterForImagesSupported(*defaultHwInfo));
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenReturnFalse) {
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
auto &helper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(helper.additionalKernelExecInfoSupported(*defaultHwInfo));
EXPECT_FALSE(helper.isDisableOverdispatchAvailable(*defaultHwInfo));
}
TEST_F(HwHelperTest, WhenGettingIsCpuImageTransferPreferredThenFalseIsReturned) {

View File

@ -298,3 +298,12 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreWhenIsBlitterForImagesSup
auto &helper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_TRUE(helper.isBlitterForImagesSupported(hwInfo));
}
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
auto hwInfo = *defaultHwInfo;
EXPECT_FALSE(hwHelper.isDisableOverdispatchAvailable(hwInfo));
hwInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(REVISION_B, hwInfo);
EXPECT_TRUE(hwHelper.isDisableOverdispatchAvailable(hwInfo));
}

View File

@ -42,35 +42,3 @@ XE_HP_CORE_TEST_F(CmdsProgrammingTestsXeHpCore, givenL1CachingOverrideWhenStateB
memoryManager->freeGraphicsMemory(allocation);
}
XE_HP_CORE_TEST_F(CmdsProgrammingTestsXeHpCore, givenInterfaceDescriptorDataWhenBSteppingIsDetectedThenTGBatchSizeIsEqualTo3) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
INTERFACE_DESCRIPTOR_DATA iddArg;
iddArg = FamilyType::cmdInitInterfaceDescriptorData;
pDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->platform.usRevId = REVISION_B;
EncodeDispatchKernel<FamilyType>::adjustInterfaceDescriptorData(iddArg, pDevice->getHardwareInfo());
EXPECT_EQ(3u, iddArg.getThreadGroupDispatchSize());
}
using PreambleCfeState = PreambleFixture;
XE_HP_CORE_TEST_F(PreambleCfeState, givenXehpBSteppingWhenCfeIsProgrammedThenOverdispatchIsDisabled) {
using CFE_STATE = typename FamilyType::CFE_STATE;
auto backup = defaultHwInfo->platform.usRevId;
defaultHwInfo->platform.usRevId = REVISION_B;
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, *defaultHwInfo, EngineGroupType::RenderCompute);
StreamProperties streamProperties{};
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, *defaultHwInfo, 0u, 0, 0, AdditionalKernelExecInfo::NotApplicable, streamProperties);
parseCommands<FamilyType>(linearStream);
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
EXPECT_TRUE(cfeState->getComputeOverdispatchDisable());
defaultHwInfo->platform.usRevId = backup;
}