refactor: change additional walker fields encoder 4/n

- move post sync system fence into dedicated encoder

Related-To: NEO-12639

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2024-10-31 09:06:05 +00:00
committed by Compute-Runtime-Automation
parent 64061b623b
commit 32fd00e150
10 changed files with 38 additions and 60 deletions

View File

@@ -27,7 +27,7 @@ PVCTEST_F(WalkerDispatchTestsPvc, givenPvcWhenEncodeAdditionalWalkerFieldsThenPo
int32_t programGlobalFenceAsPostSyncOperationInComputeWalker;
bool expectSystemMemoryFenceRequest;
} testInputs[] = {
{0x0, -1, false},
{0x0, -1, true},
{0x3, -1, true},
{0x0, 0, false},
{0x3, 0, false},
@@ -53,7 +53,7 @@ PVCTEST_F(WalkerDispatchTestsPvc, givenPvcWhenEncodeAdditionalWalkerFieldsThenPo
testInput.programGlobalFenceAsPostSyncOperationInComputeWalker);
postSyncData.setSystemMemoryFenceRequest(false);
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, walkerArgs);
EncodeDispatchKernel<FamilyType>::encodeWalkerPostSyncFields(walkerCmd, walkerArgs);
EXPECT_EQ(testInput.expectSystemMemoryFenceRequest, postSyncData.getSystemMemoryFenceRequest());
}
}
@@ -75,7 +75,7 @@ PVCTEST_F(WalkerDispatchTestsPvc, givenPvcSupportsSystemMemoryFenceWhenNoSystemF
hwInfo.platform.usDeviceID = deviceId;
postSyncData.setSystemMemoryFenceRequest(true);
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, walkerArgs);
EncodeDispatchKernel<FamilyType>::encodeWalkerPostSyncFields(walkerCmd, walkerArgs);
EXPECT_FALSE(postSyncData.getSystemMemoryFenceRequest());
}
}

View File

@@ -128,39 +128,3 @@ PVCTEST_F(CommandEncodeStatesTestPvc, GivenVariousSlmTotalSizesWhenSetPreferredS
verifyPreferredSlmValues<FamilyType>(valuesToTest, pDevice->getRootDeviceEnvironment());
}
PVCTEST_F(EncodeKernelPvcTest, givenDefaultSettingForFenceAsPostSyncOperationInComputeWalkerWhenEnqueueKernelIsCalledThenDoNotGenerateFenceCommands) {
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
using MI_MEM_FENCE = typename FamilyType::MI_MEM_FENCE;
DebugManagerStateRestore restore;
debugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(-1);
auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
auto &productHelper = pDevice->getProductHelper();
hwInfo.platform.usDeviceID = pvcXlDeviceIds[0];
VariableBackup<unsigned short> hwRevId{&hwInfo.platform.usRevId};
hwRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
uint32_t dims[] = {1, 1, 1};
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
dispatchInterface->getCrossThreadDataSizeResult = 0u;
bool requiresUncachedMocs = false;
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
dispatchArgs.isKernelUsingSystemAllocation = true;
dispatchArgs.isHostScopeSignalEvent = true;
EncodeDispatchKernel<FamilyType>::template encode<DefaultWalkerType>(*cmdContainer.get(), dispatchArgs);
GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
auto itor = find<DefaultWalkerType *>(commands.begin(), commands.end());
ASSERT_NE(itor, commands.end());
auto walkerCmd = genCmdCast<DefaultWalkerType *>(*itor);
auto &postSyncData = walkerCmd->getPostSync();
EXPECT_FALSE(postSyncData.getSystemMemoryFenceRequest());
}