Share front end state updates between regular and immediate command lists

Related-To: NEO-5019

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-09-20 16:46:15 +00:00
committed by Compute-Runtime-Automation
parent 7f0619e6b9
commit 5986a7199a
16 changed files with 415 additions and 22 deletions

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/command_stream/wait_status.h"
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/basic_math.h"
@ -2418,6 +2419,8 @@ HWTEST_F(KernelExecutionTypesTests, givenKernelWithDifferentExecutionTypeWhileDo
size_t gws[3] = {63, 0, 0};
auto &mockCsr = device->getUltCommandStreamReceiver<FamilyType>();
mockCsr.feSupportFlags.computeDispatchAllWalker = true;
pKernel->setKernelExecutionType(CL_KERNEL_EXEC_INFO_CONCURRENT_TYPE_INTEL);
mockCmdQ->enqueueKernel(pKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(mockCsr.lastKernelExecutionType, KernelExecutionType::Concurrent);

View File

@ -1529,3 +1529,118 @@ HWCMDTEST_F(IGFX_GEN8_CORE, UltCommandStreamReceiverTest, givenBarrierNodeSetWhe
EXPECT_EQ(0u, pipeControl->getImmediateData());
EXPECT_EQ(gpuAddress, UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
}
HWTEST_F(UltCommandStreamReceiverTest, givenFrontEndStateNotInitedWhenTransitionFrontEndPropertiesThenExpectCorrectValuesStored) {
auto dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.feSupportFlags.computeDispatchAllWalker = false;
commandStreamReceiver.feSupportFlags.disableEuFusion = false;
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.feSupportFlags.disableOverdispatch = true;
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::NotApplicable;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::DisableOverdispatch;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.feSupportFlags.disableOverdispatch = false;
commandStreamReceiver.lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.feSupportFlags.computeDispatchAllWalker = true;
dispatchFlags.kernelExecutionType = KernelExecutionType::NotApplicable;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.kernelExecutionType = KernelExecutionType::Default;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.kernelExecutionType = KernelExecutionType::Concurrent;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.feSupportFlags.computeDispatchAllWalker = false;
commandStreamReceiver.lastKernelExecutionType = KernelExecutionType::Default;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.feSupportFlags.disableEuFusion = true;
dispatchFlags.disableEUFusion = false;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.streamProperties.frontEndState.disableEUFusion.value = 0;
dispatchFlags.disableEUFusion = true;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
dispatchFlags.disableEUFusion = false;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.feSupportFlags.disableEuFusion = false;
commandStreamReceiver.streamProperties.frontEndState.disableEUFusion.value = -1;
dispatchFlags.disableEUFusion = false;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
}
HWTEST_F(UltCommandStreamReceiverTest, givenFrontEndStateInitedWhenTransitionFrontEndPropertiesThenExpectCorrectValuesStored) {
auto dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.feSupportFlags.computeDispatchAllWalker = false;
commandStreamReceiver.feSupportFlags.disableEuFusion = false;
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.feSupportFlags.disableOverdispatch = true;
commandStreamReceiver.streamProperties.frontEndState.disableOverdispatch.value = 0;
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::DisableOverdispatch;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.streamProperties.frontEndState.disableOverdispatch.value = 1;
dispatchFlags.additionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.feSupportFlags.disableOverdispatch = false;
commandStreamReceiver.feSupportFlags.computeDispatchAllWalker = true;
commandStreamReceiver.streamProperties.frontEndState.computeDispatchAllWalkerEnable.value = 0;
dispatchFlags.kernelExecutionType = KernelExecutionType::Default;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
dispatchFlags.kernelExecutionType = KernelExecutionType::Concurrent;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
commandStreamReceiver.streamProperties.frontEndState.computeDispatchAllWalkerEnable.value = 1;
dispatchFlags.kernelExecutionType = KernelExecutionType::Default;
commandStreamReceiver.handleFrontEndStateTransition(dispatchFlags);
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
commandStreamReceiver.setMediaVFEStateDirty(false);
}

View File

@ -153,6 +153,7 @@ struct UltCommandStreamReceiverTest
commandStreamReceiver.lastSentUseGlobalAtomics = false;
commandStreamReceiver.streamProperties.stateComputeMode.setProperties(0, GrfConfig::DefaultGrfNumber,
hwHelper.getDefaultThreadArbitrationPolicy(), pDevice->getPreemptionMode(), *defaultHwInfo);
commandStreamReceiver.streamProperties.frontEndState.setProperties(false, false, false, -1, *defaultHwInfo);
auto logicalStateHelper = commandStreamReceiver.getLogicalStateHelper();