mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
fix: fallback ioq appendSignalEvent to appendBarrier 2
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0b65b86ccb
commit
1ac3ebaf2c
@@ -3062,11 +3062,16 @@ inline ze_result_t CommandListCoreFamily<gfxCoreFamily>::addEventsToCmdList(uint
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent(ze_event_handle_t hEvent, bool relaxedOrderingDispatch) {
|
||||
auto event = Event::fromHandle(hEvent);
|
||||
|
||||
if (event->isCounterBased()) {
|
||||
return appendBarrier(hEvent, 0, nullptr, relaxedOrderingDispatch);
|
||||
}
|
||||
|
||||
if (this->isInOrderExecutionEnabled()) {
|
||||
handleInOrderImplicitDependencies(relaxedOrderingDispatch, false);
|
||||
}
|
||||
|
||||
auto event = Event::fromHandle(hEvent);
|
||||
event->resetKernelCountAndPacketUsedCount();
|
||||
|
||||
if (!handleCounterBasedEventOperations(event, false)) {
|
||||
@@ -4246,8 +4251,10 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBarrier(ze_event_handle_
|
||||
appendSynchronizedDispatchInitializationSection();
|
||||
|
||||
Event *signalEvent = nullptr;
|
||||
bool hostVisibleEvent = false;
|
||||
if (hSignalEvent) {
|
||||
signalEvent = Event::fromHandle(hSignalEvent);
|
||||
hostVisibleEvent = signalEvent->isSignalScope(ZE_EVENT_SCOPE_FLAG_HOST);
|
||||
}
|
||||
|
||||
if (!handleCounterBasedEventOperations(signalEvent, false)) {
|
||||
@@ -4276,7 +4283,10 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBarrier(ze_event_handle_
|
||||
}
|
||||
|
||||
addToMappedEventList(signalEvent);
|
||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, this->isInOrderExecutionEnabled(), false, isCopyOnly(false));
|
||||
|
||||
bool skipPipeControl = this->isInOrderExecutionEnabled() && !getDcFlushRequired(hostVisibleEvent);
|
||||
|
||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, skipPipeControl, false, isCopyOnly(false));
|
||||
|
||||
if (isInOrderExecutionEnabled()) {
|
||||
appendSignalInOrderDependencyCounter(signalEvent, false, false, false);
|
||||
|
||||
@@ -1154,7 +1154,7 @@ HWTEST_F(InOrderCmdListTests, givenDependencyFromDifferentRootDeviceWhenAppendCa
|
||||
auto immCmdList0 = createCmdList(device0);
|
||||
auto immCmdList1 = createCmdList(device1);
|
||||
|
||||
immCmdList0->appendSignalEvent(eventH, false);
|
||||
immCmdList0->appendLaunchKernel(kernel->toHandle(), groupCount, eventH, 0, nullptr, launchParams);
|
||||
|
||||
auto &cmdContainer1 = immCmdList1->getCmdContainer();
|
||||
auto cmdStream = cmdContainer1.getCommandStream();
|
||||
@@ -1195,6 +1195,7 @@ HWTEST_F(InOrderCmdListTests, givenTimestmapEventWhenProgrammingBarrierThenDontA
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(1, true);
|
||||
auto eventHandle = events[0]->toHandle();
|
||||
events[0]->signalScope = 0;
|
||||
|
||||
auto immCmdList = createImmCmdList<FamilyType::gfxCoreFamily>();
|
||||
|
||||
@@ -2244,7 +2245,7 @@ HWTEST2_F(InOrderCmdListTests, givenRelaxedOrderingEnabledWhenSignalEventCalledT
|
||||
auto immCmdList1 = createImmCmdList<FamilyType::gfxCoreFamily>();
|
||||
auto immCmdList2 = createImmCmdList<FamilyType::gfxCoreFamily>();
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(2, false);
|
||||
auto eventPool = createEvents<FamilyType>(2, true);
|
||||
events[1]->makeCounterBasedInitiallyDisabled(eventPool->getAllocation());
|
||||
auto nonCbEvent = events[1]->toHandle();
|
||||
|
||||
@@ -2965,6 +2966,32 @@ HWTEST2_F(InOrderCmdListTests, givenRelaxedOrderingWhenProgrammingTimestampEvent
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(InOrderCmdListTests, givenCbEventWhenAppendSignalEventCalledThenFallbackToAppendBarrier) {
|
||||
class MyMockCmdList : public WhiteBox<L0::CommandListCoreFamilyImmediate<FamilyType::gfxCoreFamily>> {
|
||||
public:
|
||||
using BaseClass = WhiteBox<L0::CommandListCoreFamilyImmediate<FamilyType::gfxCoreFamily>>;
|
||||
using BaseClass::BaseClass;
|
||||
|
||||
ze_result_t appendBarrier(ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) override {
|
||||
appendBarrierCalled++;
|
||||
return BaseClass::appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
|
||||
}
|
||||
|
||||
uint32_t appendBarrierCalled = 0;
|
||||
};
|
||||
|
||||
auto immCmdList = createImmCmdListImpl<FamilyType::gfxCoreFamily, MyMockCmdList>(false);
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(2, true);
|
||||
events[0]->makeCounterBasedInitiallyDisabled(eventPool->getAllocation());
|
||||
|
||||
immCmdList->appendSignalEvent(events[0]->toHandle(), false);
|
||||
EXPECT_EQ(0u, immCmdList->appendBarrierCalled);
|
||||
|
||||
immCmdList->appendSignalEvent(events[1]->toHandle(), false);
|
||||
EXPECT_EQ(1u, immCmdList->appendBarrierCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenRelaxedOrderingWhenProgrammingTimestampEventCbThenClearOnHstAndChainWithSyncAllocSignalingAsTwoSeparateSubmissions, IsAtLeastXeHpcCore) {
|
||||
class MyMockCmdList : public WhiteBox<L0::CommandListCoreFamilyImmediate<FamilyType::gfxCoreFamily>> {
|
||||
public:
|
||||
|
||||
@@ -2441,11 +2441,11 @@ struct StandaloneInOrderTimestampAllocationTests : public InOrderCmdListFixture
|
||||
|
||||
HWTEST_F(StandaloneInOrderTimestampAllocationTests, givenSignalScopeEventWhenSignalEventIsCalledThenProgramPipeControl) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
auto eventPool = createEvents<FamilyType>(2, false);
|
||||
auto eventPool = createEvents<FamilyType>(2, true);
|
||||
|
||||
auto cmdList = createImmCmdList<FamilyType::gfxCoreFamily>();
|
||||
|
||||
events[0]->signalScope = true;
|
||||
events[0]->signalScope = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
events[1]->signalScope = false;
|
||||
|
||||
auto cmdStream = cmdList->getCmdContainer().getCommandStream();
|
||||
|
||||
Reference in New Issue
Block a user