mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
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:
committed by
Compute-Runtime-Automation
parent
8699384031
commit
41b62185b8
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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] = {};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user