refactor: change preamble method from virtual to regular

Related-To: NEO-16434

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-10-17 12:11:34 +00:00
committed by Compute-Runtime-Automation
parent 8699384031
commit 41b62185b8
5 changed files with 17 additions and 7 deletions

View File

@@ -523,7 +523,7 @@ struct CommandList : _ze_command_list_handle_t {
return flags;
}
virtual void setPatchingPreamble(bool patching, bool saveWait) {}
void setPatchingPreamble(bool patching, bool saveWait);
uint32_t getActiveScratchPatchElements() const {
return activeScratchPatchElements;

View File

@@ -240,7 +240,6 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily<gfxCoreFami
bool isBarrierRequired();
bool isRelaxedOrderingDispatchAllowed(uint32_t numWaitEvents, bool copyOffload) override;
bool skipInOrderNonWalkerSignalingAllowed(ze_event_handle_t signalEvent) const override;
void setPatchingPreamble(bool patching, bool saveWait) override;
protected:
using BaseClass::inOrderExecInfo;

View File

@@ -2031,9 +2031,4 @@ size_t CommandListCoreFamilyImmediate<gfxCoreFamily>::estimateAdditionalSizeAppe
return additionalSize;
}
template <GFXCORE_FAMILY gfxCoreFamily>
inline void CommandListCoreFamilyImmediate<gfxCoreFamily>::setPatchingPreamble(bool patching, bool saveWait) {
this->cmdQImmediate->setPatchingPreamble(patching, saveWait);
}
} // namespace L0

View File

@@ -33,6 +33,12 @@ namespace L0 {
CommandList::CommandList(uint32_t numIddsPerBlock) : commandContainer(numIddsPerBlock) {}
void CommandList::setPatchingPreamble(bool patching, bool saveWait) {
if (isImmediateType()) {
cmdQImmediate->setPatchingPreamble(patching, saveWait);
}
}
CommandListAllocatorFn commandListFactory[IGFX_MAX_PRODUCT] = {};
CommandListAllocatorFn commandListFactoryImmediate[IGFX_MAX_PRODUCT] = {};

View File

@@ -15,6 +15,7 @@
#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h"
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
#include "level_zero/core/test/unit_tests/mocks/mock_graph.h"
#include "level_zero/core/test/unit_tests/mocks/mock_module.h"
@@ -1401,7 +1402,9 @@ TEST_F(GraphExecution, GivenExecutableGraphWhenSubmittingItToCommandListThenAppe
GraphsCleanupGuard graphCleanup;
MockGraphContextReturningSpecificCmdList ctx;
Mock<CommandQueue> cmdQueue;
Mock<CommandList> cmdlist;
cmdlist.cmdQImmediate = &cmdQueue;
cmdlist.cmdListType = L0::CommandList::CommandListType::typeImmediate;
auto cmdListHandle = cmdlist.toHandle();
@@ -1424,6 +1427,7 @@ TEST_F(GraphExecution, GivenExecutableGraphWhenSubmittingItToCommandListThenAppe
EXPECT_EQ(1U, cmdlist.appendCommandListsCalled);
EXPECT_EQ(0U, cmdlist.appendWaitOnEventsCalled);
EXPECT_EQ(0U, cmdlist.appendSignalEventCalled);
cmdlist.cmdQImmediate = nullptr;
}
TEST_F(GraphExecution, GivenExecutableGraphWithSubGraphsWhenSubmittingItToCommandListSubmitAlsoSubGraphsToRespectiveCommandLists) {
@@ -1433,6 +1437,9 @@ TEST_F(GraphExecution, GivenExecutableGraphWithSubGraphsWhenSubmittingItToComman
MockGraphCmdListWithContext mainRecordCmdlist{&ctx};
MockGraphCmdListWithContext mainExecCmdlist{&ctx};
MockGraphCmdListWithContext subCmdlist{&ctx};
Mock<CommandQueue> cmdQueue;
mainExecCmdlist.cmdQImmediate = &cmdQueue;
subCmdlist.cmdQImmediate = &cmdQueue;
auto subCmdlistHandle = subCmdlist.toHandle();
Mock<Event> signalEventParent; // fork
@@ -1483,6 +1490,9 @@ TEST_F(GraphExecution, GivenExecutableGraphWithSubGraphsWhenSubmittingItToComman
EXPECT_EQ(1U, subCmdlist.appendCommandListsCalled);
EXPECT_EQ(0U, subCmdlist.appendWaitOnEventsCalled);
EXPECT_EQ(0U, subCmdlist.appendSignalEventCalled);
mainExecCmdlist.cmdQImmediate = nullptr;
subCmdlist.cmdQImmediate = nullptr;
}
TEST_F(GraphExecution, GivenGraphWithForkWhenInstantiatingToExecutableAndAppendReturnFailThenReturnCorrectErrorCode) {