Correct programComputeMode function

Reset all fields of StreamProperties when
compute mode command is being programmed.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2021-12-10 13:50:04 +00:00
committed by Compute-Runtime-Automation
parent f5998b15fc
commit cdc064f478
3 changed files with 9 additions and 7 deletions

View File

@@ -293,10 +293,8 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithSharedH
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
auto cmd = genCmdCast<STATE_COMPUTE_MODE *>(*it);
if (cmd) {
if (valueChanged) {
EXPECT_EQ(expectedCoherentValue, cmd->getForceNonCoherent());
}
EXPECT_EQ(valueChanged ? expectedCoherentMask : 0u, cmd->getMaskBits());
EXPECT_EQ(expectedCoherentValue, cmd->getForceNonCoherent());
EXPECT_EQ(expectedCoherentMask, cmd->getMaskBits());
EXPECT_FALSE(foundOne);
foundOne = true;
auto pc = genCmdCast<PIPE_CONTROL *>(*(++it));

View File

@@ -184,12 +184,14 @@ PVCTEST_F(PvcComputeModeRequirements, giventhreadArbitrationPolicyWithoutSharedH
hwParser.parseCommands<FamilyType>(getCsrHw<FamilyType>()->commandStream, startOffset);
bool foundOne = false;
uint32_t expectedCoherentMask = FamilyType::stateComputeModeEuThreadSchedulingModeOverrideMask;
uint32_t expectedCoherentMask = FamilyType::stateComputeModeEuThreadSchedulingModeOverrideMask |
FamilyType::stateComputeModeLargeGrfModeMask |
FamilyType::stateComputeModeForceNonCoherentMask;
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
auto cmd = genCmdCast<STATE_COMPUTE_MODE *>(*it);
if (cmd) {
EXPECT_EQ(expectToBeProgrammed ? expectedCoherentMask : 0u, cmd->getMaskBits());
EXPECT_EQ(expectedCoherentMask, cmd->getMaskBits());
EXPECT_FALSE(foundOne);
foundOne = true;
auto pc = genCmdCast<PIPE_CONTROL *>(*(++it));

View File

@@ -26,7 +26,9 @@ void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream
addPipeControlPriorToNonPipelinedStateCommand(stream, args);
}
EncodeComputeMode<GfxFamily>::programComputeModeCommand(stream, this->streamProperties.stateComputeMode, hwInfo);
StreamProperties streamProperties{};
streamProperties.stateComputeMode.setProperties(this->streamProperties.stateComputeMode);
EncodeComputeMode<GfxFamily>::programComputeModeCommand(stream, streamProperties.stateComputeMode, hwInfo);
if (csrSizeRequestFlags.hasSharedHandles) {
auto pc = stream.getSpaceForCmd<PIPE_CONTROL>();