refactor: pass additional in-order params to PatchCmd helper

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-12-21 13:48:32 +00:00
committed by Compute-Runtime-Automation
parent 18fb432552
commit d6560c5bba
4 changed files with 17 additions and 12 deletions

View File

@@ -150,7 +150,7 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingThenSetCorrectValu
auto cmd = FamilyType::cmdInitStoreDataImm;
cmd.setDataDword0(1);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, reinterpret_cast<void *>(&cmd), nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::sdi);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, reinterpret_cast<void *>(&cmd), nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::sdi, false, false);
patchCmd.patch(2);
EXPECT_EQ(3u, cmd.getDataDword0());
@@ -160,7 +160,7 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingThenSetCorrectValu
auto cmd = FamilyType::cmdInitMiSemaphoreWait;
cmd.setSemaphoreDataDword(1);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::semaphore);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::semaphore, false, false);
patchCmd.patch(2);
EXPECT_EQ(1u, cmd.getSemaphoreDataDword());
@@ -168,7 +168,7 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingThenSetCorrectValu
patchCmd.patch(3);
EXPECT_EQ(3u, cmd.getSemaphoreDataDword());
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmdInternal(nullptr, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::semaphore);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmdInternal(nullptr, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::semaphore, false, false);
patchCmdInternal.patch(3);
EXPECT_EQ(4u, cmd.getSemaphoreDataDword());
@@ -182,7 +182,7 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingThenSetCorrectValu
inOrderExecInfo->reset();
inOrderExecInfo->addCounterValue(1);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd1, &cmd2, 1, InOrderPatchCommandHelpers::PatchCmdType::lri64b);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd1, &cmd2, 1, InOrderPatchCommandHelpers::PatchCmdType::lri64b, false, false);
patchCmd.patch(3);
EXPECT_EQ(1u, cmd1.getDataDword());
EXPECT_EQ(1u, cmd2.getDataDword());
@@ -192,14 +192,14 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingThenSetCorrectValu
EXPECT_EQ(3u, cmd1.getDataDword());
EXPECT_EQ(0u, cmd2.getDataDword());
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmdInternal(nullptr, &cmd1, &cmd2, 1, InOrderPatchCommandHelpers::PatchCmdType::lri64b);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmdInternal(nullptr, &cmd1, &cmd2, 1, InOrderPatchCommandHelpers::PatchCmdType::lri64b, false, false);
patchCmdInternal.patch(2);
EXPECT_EQ(3u, cmd1.getDataDword());
EXPECT_EQ(0u, cmd2.getDataDword());
}
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, nullptr, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::none);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, nullptr, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::none, false, false);
EXPECT_ANY_THROW(patchCmd.patch(1));
}
@@ -214,7 +214,7 @@ HWTEST_F(CommandEncoderTests, givenInOrderExecInfoWhenPatchingWalkerThenSetCorre
auto cmd = FamilyType::cmdInitGpgpuWalker;
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::walker);
InOrderPatchCommandHelpers::PatchCmd<FamilyType> patchCmd(&inOrderExecInfo, &cmd, nullptr, 1, InOrderPatchCommandHelpers::PatchCmdType::walker, false, false);
if constexpr (FamilyType::walkerPostSyncSupport) {
patchCmd.patch(2);