feature: enable in-order regular cmd lists patching

Related-To: NEO-7966

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-09-26 08:11:40 +00:00
committed by Compute-Runtime-Automation
parent eebf2bbd26
commit 97b8cac1d1
2 changed files with 21 additions and 13 deletions

View File

@@ -3457,7 +3457,7 @@ void CommandListCoreFamily<gfxCoreFamily>::appendWaitOnSingleEvent(Event *event,
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandListCoreFamily<gfxCoreFamily>::addCmdForPatching(void *cmd, uint64_t counterValue, InOrderPatchCommandTypes::CmdType cmdType) {
if ((NEO::DebugManager.flags.EnableInOrderRegularCmdListPatching.get() == 1) && (this->cmdListType == TYPE_REGULAR)) {
if ((NEO::DebugManager.flags.EnableInOrderRegularCmdListPatching.get() != 0) && (this->cmdListType == TYPE_REGULAR)) {
this->inOrderPatchCmds.emplace_back(cmd, counterValue, cmdType);
}
}

View File

@@ -2805,9 +2805,7 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenDoingCpuCopyThenSynchronize,
context->freeMem(deviceAlloc);
}
HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenUsingImmediateCmdListThenDontAddCmdsToPatch, IsAtLeastXeHpCore) {
DebugManager.flags.EnableInOrderRegularCmdListPatching.set(1);
HWTEST2_F(InOrderCmdListTests, wWhenUsingImmediateCmdListThenDontAddCmdsToPatch, IsAtLeastXeHpCore) {
auto immCmdList = createCopyOnlyImmCmdList<gfxCoreFamily>();
uint32_t copyData = 0;
@@ -3162,11 +3160,9 @@ HWTEST2_F(MultiTileInOrderCmdListTests, givenMultiTileInOrderModeWhenProgramming
EXPECT_EQ(eventEndGpuVa + offset, semaphoreCmd->getSemaphoreGraphicsAddress());
}
HWTEST2_F(MultiTileInOrderCmdListTests, givenDebugFlagSetWhenUsingRegularCmdListThenAddWalkerToPatch, IsAtLeastXeHpCore) {
HWTEST2_F(MultiTileInOrderCmdListTests, whenUsingRegularCmdListThenAddWalkerToPatch, IsAtLeastXeHpCore) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
DebugManager.flags.EnableInOrderRegularCmdListPatching.set(1);
ze_command_queue_desc_t desc = {};
auto mockCmdQHw = makeZeUniquePtr<MockCommandQueueHw<gfxCoreFamily>>(device, device->getNEODevice()->getDefaultEngine().commandStreamReceiver, &desc);
@@ -3367,12 +3363,10 @@ HWTEST2_F(InOrderRegularCmdListTests, givenInOrderFlagWhenCreatingCmdListThenEna
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListDestroy(cmdList));
}
HWTEST2_F(InOrderRegularCmdListTests, givenDebugFlagSetWhenUsingRegularCmdListThenAddCmdsToPatch, IsAtLeastXeHpCore) {
HWTEST2_F(InOrderRegularCmdListTests, whenUsingRegularCmdListThenAddCmdsToPatch, IsAtLeastXeHpCore) {
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
DebugManager.flags.EnableInOrderRegularCmdListPatching.set(1);
ze_command_queue_desc_t desc = {};
auto mockCmdQHw = makeZeUniquePtr<MockCommandQueueHw<gfxCoreFamily>>(device, device->getNEODevice()->getDefaultEngine().commandStreamReceiver, &desc);
@@ -3463,10 +3457,24 @@ HWTEST2_F(InOrderRegularCmdListTests, givenDebugFlagSetWhenUsingRegularCmdListTh
verifyPatching(2);
}
HWTEST2_F(InOrderRegularCmdListTests, givenDebugFlagSetWhenUsingRegularCmdListThenAddWalkerToPatch, IsAtLeastXeHpCore) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
HWTEST2_F(InOrderRegularCmdListTests, givenDebugFlagSetWhenUsingRegularCmdListThenDontAddCmdsToPatch, IsAtLeastXeHpCore) {
DebugManager.flags.EnableInOrderRegularCmdListPatching.set(0);
DebugManager.flags.EnableInOrderRegularCmdListPatching.set(1);
ze_command_queue_desc_t desc = {};
auto mockCmdQHw = makeZeUniquePtr<MockCommandQueueHw<gfxCoreFamily>>(device, device->getNEODevice()->getDefaultEngine().commandStreamReceiver, &desc);
mockCmdQHw->initialize(true, false, false);
auto regularCmdList = createRegularCmdList<gfxCoreFamily>(true);
uint32_t copyData = 0;
regularCmdList->appendMemoryCopy(&copyData, &copyData, 1, nullptr, 0, nullptr, false, false);
EXPECT_EQ(0u, regularCmdList->inOrderPatchCmds.size());
}
HWTEST2_F(InOrderRegularCmdListTests, whenUsingRegularCmdListThenAddWalkerToPatch, IsAtLeastXeHpCore) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
ze_command_queue_desc_t desc = {};