Add debug flag to control programming of thread arbitration policy with SCM

Related-To: NEO-6801

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2022-05-16 20:34:53 +00:00
committed by Compute-Runtime-Automation
parent ec6d580a27
commit 35d1f2e341
28 changed files with 96 additions and 22 deletions

View File

@@ -152,7 +152,6 @@ struct Kernel : _ze_kernel_handle_t, virtual NEO::DispatchKernelEncoderI {
virtual NEO::GraphicsAllocation *getPrivateMemoryGraphicsAllocation() = 0;
virtual ze_result_t setSchedulingHintExp(ze_scheduling_hint_exp_desc_t *pHint) = 0;
virtual int32_t getSchedulingHintExp() = 0;
Kernel() = default;
Kernel(const Kernel &) = delete;

View File

@@ -1056,7 +1056,7 @@ ze_result_t KernelImp::setSchedulingHintExp(ze_scheduling_hint_exp_desc_t *pHint
return ZE_RESULT_SUCCESS;
}
int32_t KernelImp::getSchedulingHintExp() {
int32_t KernelImp::getSchedulingHintExp() const {
return this->schedulingHintExpFlag;
}
} // namespace L0

View File

@@ -164,7 +164,7 @@ struct KernelImp : Kernel {
}
ze_result_t setSchedulingHintExp(ze_scheduling_hint_exp_desc_t *pHint) override;
int32_t getSchedulingHintExp() override;
int32_t getSchedulingHintExp() const override;
NEO::ImplicitArgs *getImplicitArgs() const override { return pImplicitArgs.get(); }

View File

@@ -70,12 +70,13 @@ HWTEST2_F(CommandListExecuteImmediate, whenExecutingCommandListImmediateWithFlus
int expectedDisableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(*defaultHwInfo);
bool expectedIsCoherencyRequired = hwHelper.forceNonGpuCoherencyWA(true);
int expectedLargeGrfMode = hwInfoConfig.isGrfNumReportedWithScm() ? 1 : -1;
int expectedThreadArbitrationPolicy = hwInfoConfig.isThreadArbitrationPolicyReportedWithScm() ? NEO::ThreadArbitrationPolicy::RoundRobin : -1;
EXPECT_EQ(1, currentCsrStreamProperties.frontEndState.computeDispatchAllWalkerEnable.value);
EXPECT_EQ(1, currentCsrStreamProperties.frontEndState.disableEUFusion.value);
EXPECT_EQ(expectedDisableOverdispatch, currentCsrStreamProperties.frontEndState.disableOverdispatch.value);
EXPECT_EQ(expectedIsCoherencyRequired, currentCsrStreamProperties.stateComputeMode.isCoherencyRequired.value);
EXPECT_EQ(expectedLargeGrfMode, currentCsrStreamProperties.stateComputeMode.largeGrfMode.value);
EXPECT_EQ(NEO::ThreadArbitrationPolicy::RoundRobin, currentCsrStreamProperties.stateComputeMode.threadArbitrationPolicy.value);
EXPECT_EQ(expectedThreadArbitrationPolicy, currentCsrStreamProperties.stateComputeMode.threadArbitrationPolicy.value);
commandListImmediate.requiredStreamState.frontEndState.computeDispatchAllWalkerEnable.value = 0;
commandListImmediate.requiredStreamState.frontEndState.disableEUFusion.value = 0;
@@ -86,12 +87,13 @@ HWTEST2_F(CommandListExecuteImmediate, whenExecutingCommandListImmediateWithFlus
commandListImmediate.executeCommandListImmediateWithFlushTask(false);
expectedLargeGrfMode = hwInfoConfig.isGrfNumReportedWithScm() ? 0 : -1;
expectedThreadArbitrationPolicy = hwInfoConfig.isThreadArbitrationPolicyReportedWithScm() ? NEO::ThreadArbitrationPolicy::AgeBased : -1;
EXPECT_EQ(0, currentCsrStreamProperties.frontEndState.computeDispatchAllWalkerEnable.value);
EXPECT_EQ(0, currentCsrStreamProperties.frontEndState.disableEUFusion.value);
EXPECT_EQ(0, currentCsrStreamProperties.frontEndState.disableOverdispatch.value);
EXPECT_EQ(0, currentCsrStreamProperties.stateComputeMode.isCoherencyRequired.value);
EXPECT_EQ(expectedLargeGrfMode, currentCsrStreamProperties.stateComputeMode.largeGrfMode.value);
EXPECT_EQ(NEO::ThreadArbitrationPolicy::AgeBased, currentCsrStreamProperties.stateComputeMode.threadArbitrationPolicy.value);
EXPECT_EQ(expectedThreadArbitrationPolicy, currentCsrStreamProperties.stateComputeMode.threadArbitrationPolicy.value);
}
HWTEST2_F(CommandListExecuteImmediate, whenExecutingCommandListImmediateWithFlushTaskThenContainsAnyKernelFlagIsReset, IsAtLeastSkl) {

View File

@@ -84,6 +84,9 @@ HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithStallRRThreadArbitrationP
}
HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithThreadArbitrationPolicySetUsingSchedulingHintExtensionTheSameFlagIsUsedToSetCmdListThreadArbitrationPolicy) {
DebugManagerStateRestore restorer;
DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1);
createKernel();
ze_scheduling_hint_exp_desc_t *pHint = new ze_scheduling_hint_exp_desc_t;
pHint->pNext = nullptr;
@@ -109,6 +112,7 @@ HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithThreadArbitrationPolicySe
DebugManagerStateRestore restorer;
DebugManager.flags.OverrideThreadArbitrationPolicy.set(0);
DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1);
ze_group_count_t groupCount{1, 1, 1};
ze_result_t returnValue;

View File

@@ -1240,6 +1240,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernel
HWTEST2_F(CommandListAppendLaunchKernel, GivenDebugToggleSetWhenUpdateStreamPropertiesIsCalledThenCorrectThreadArbitrationPolicyIsSet, IsAtLeastSkl) {
DebugManagerStateRestore restorer;
DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1);
auto &hwHelper = NEO::HwHelper::get(device->getHwInfo().platform.eRenderCoreFamily);
auto defaultThreadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy();