Skip to content

Commit a5ac961

Browse files
Do not program thread arbitration policy on command list init and reset
This logic is now redundant and can be removed. Related-To: NEO-6728 Signed-off-by: Filip Hazubski <[email protected]>
1 parent a71b88f commit a5ac961

File tree

4 files changed

+6
-26
lines changed

4 files changed

+6
-26
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ struct CommandListCoreFamily : CommandListImp {
239239
void appendEventForProfilingCopyCommand(ze_event_handle_t hEvent, bool beforeWalker);
240240
void appendSignalEventPostWalker(ze_event_handle_t hEvent);
241241
void programStateBaseAddress(NEO::CommandContainer &container, bool genericMediaStateClearRequired);
242-
void programThreadArbitrationPolicy(Device *device);
243242
void appendComputeBarrierCommand();
244243
NEO::PipeControlArgs createBarrierFlags();
245244
void appendMultiTileBarrier(NEO::Device &neoDevice);

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ CommandListCoreFamily<gfxCoreFamily>::~CommandListCoreFamily() {
7070
this->patternAllocations.clear();
7171
}
7272

73-
template <GFXCORE_FAMILY gfxCoreFamily>
74-
void CommandListCoreFamily<gfxCoreFamily>::programThreadArbitrationPolicy(Device *device) {
75-
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
76-
auto &hwHelper = NEO::HwHelper::get(device->getNEODevice()->getHardwareInfo().platform.eRenderCoreFamily);
77-
auto threadArbitrationPolicy = hwHelper.getDefaultThreadArbitrationPolicy();
78-
if (NEO::DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) {
79-
threadArbitrationPolicy = static_cast<uint32_t>(NEO::DebugManager.flags.OverrideThreadArbitrationPolicy.get());
80-
}
81-
NEO::StreamProperties streamProperties{};
82-
streamProperties.stateComputeMode.threadArbitrationPolicy.set(threadArbitrationPolicy);
83-
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*commandContainer.getCommandStream(), streamProperties.stateComputeMode,
84-
this->device->getHwInfo());
85-
}
86-
8773
template <GFXCORE_FAMILY gfxCoreFamily>
8874
ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
8975
printfFunctionContainer.clear();
@@ -115,7 +101,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
115101
programStateBaseAddress(commandContainer, false);
116102
}
117103
commandContainer.setDirtyStateForAllHeaps(false);
118-
programThreadArbitrationPolicy(device);
119104
}
120105

121106
for (auto alloc : this->ownedPrivateAllocations) {
@@ -160,7 +145,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
160145
}
161146
}
162147
commandContainer.setDirtyStateForAllHeaps(false);
163-
programThreadArbitrationPolicy(device);
164148
}
165149
}
166150

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryCopyRegionHavingHostMemor
284284
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
285285

286286
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
287-
EXPECT_EQ(8u, allPcCommands.size());
287+
EXPECT_EQ(7u, allPcCommands.size());
288288
}
289289

290290
HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryCopyRegionHavingDeviceMemoryWithSignalAndWaitEventsUsingRenderEngineThenPipeControlIsNotFound, PlatformSupport) {
@@ -331,7 +331,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryCopyRegionHavingDeviceMem
331331
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
332332

333333
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
334-
EXPECT_EQ(7u, allPcCommands.size());
334+
EXPECT_EQ(6u, allPcCommands.size());
335335

336336
context->freeMem(srcBuffer);
337337
context->freeMem(dstBuffer);
@@ -374,7 +374,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingDeviceMemoryWit
374374
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
375375

376376
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
377-
EXPECT_EQ(7u, allPcCommands.size());
377+
EXPECT_EQ(6u, allPcCommands.size());
378378

379379
context->freeMem(dstBuffer);
380380
}
@@ -417,7 +417,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingSharedMemoryWit
417417
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
418418

419419
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
420-
EXPECT_EQ(8u, allPcCommands.size());
420+
EXPECT_EQ(7u, allPcCommands.size());
421421

422422
context->freeMem(dstBuffer);
423423
}
@@ -460,7 +460,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingHostMemoryWithS
460460
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
461461

462462
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
463-
EXPECT_EQ(7u, allPcCommands.size());
463+
EXPECT_EQ(6u, allPcCommands.size());
464464

465465
context->freeMem(dstBuffer);
466466
}
@@ -506,7 +506,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryFillHavingEventsWithDevic
506506
auto itor = find<SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end());
507507
EXPECT_NE(cmdList.end(), itor);
508508
auto allPcCommands = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
509-
EXPECT_EQ(7u, allPcCommands.size());
509+
EXPECT_EQ(6u, allPcCommands.size());
510510
auto cmd = genCmdCast<PIPE_CONTROL *>(*allPcCommands.back());
511511
EXPECT_TRUE(cmd->getDcFlushEnable());
512512

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,6 @@ HWTEST2_F(HostPointerManagerCommandListTest, givenCommandListWhenMemoryFillWithS
950950
EXPECT_NE(cmdList.end(), itor);
951951
itor++;
952952
itor = find<PIPE_CONTROL *>(itor, cmdList.end());
953-
EXPECT_NE(cmdList.end(), itor);
954-
itor++;
955-
itor = find<PIPE_CONTROL *>(itor, cmdList.end());
956953
EXPECT_EQ(cmdList.end(), itor);
957954
}
958955

0 commit comments

Comments
 (0)