@@ -1450,7 +1450,26 @@ void CommandListCoreFamily<gfxCoreFamily>::appendSignalEventPostWalker(ze_event_
14501450 if (event->isEventTimestampFlagSet ()) {
14511451 appendEventForProfiling (hEvent, false );
14521452 } else {
1453- CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent (hEvent);
1453+ using POST_SYNC_OPERATION = typename GfxFamily::PIPE_CONTROL::POST_SYNC_OPERATION;
1454+ using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
1455+ auto event = Event::fromHandle (hEvent);
1456+
1457+ commandContainer.addToResidencyContainer (&event->getAllocation (this ->device ));
1458+ uint64_t baseAddr = event->getGpuAddress (this ->device );
1459+
1460+ if (isCopyOnly ()) {
1461+ NEO::MiFlushArgs args;
1462+ args.commandWithPostSync = true ;
1463+ NEO::EncodeMiFlushDW<GfxFamily>::programMiFlushDw (*commandContainer.getCommandStream (), baseAddr, Event::STATE_SIGNALED, args);
1464+ } else {
1465+ NEO::PipeControlArgs args;
1466+ args.dcFlushEnable = (!event->signalScope ) ? false : true ;
1467+ NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation (
1468+ *commandContainer.getCommandStream (), POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
1469+ baseAddr, Event::STATE_SIGNALED,
1470+ commandContainer.getDevice ()->getHardwareInfo (),
1471+ args);
1472+ }
14541473 }
14551474}
14561475
@@ -1560,6 +1579,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent(ze_event_han
15601579 using POST_SYNC_OPERATION = typename GfxFamily::PIPE_CONTROL::POST_SYNC_OPERATION;
15611580 using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
15621581 auto event = Event::fromHandle (hEvent);
1582+ bool applyScope = false ;
15631583
15641584 commandContainer.addToResidencyContainer (&event->getAllocation (this ->device ));
15651585 uint64_t baseAddr = event->getGpuAddress (this ->device );
@@ -1574,12 +1594,23 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent(ze_event_han
15741594 NEO::EncodeMiFlushDW<GfxFamily>::programMiFlushDw (*commandContainer.getCommandStream (), ptrOffset (baseAddr, eventSignalOffset), Event::STATE_SIGNALED, args);
15751595 } else {
15761596 NEO::PipeControlArgs args;
1577- args.dcFlushEnable = (!event->signalScope ) ? false : true ;
1578- NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation (
1579- *commandContainer.getCommandStream (), POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
1580- ptrOffset (baseAddr, eventSignalOffset), Event::STATE_SIGNALED,
1581- commandContainer.getDevice ()->getHardwareInfo (),
1582- args);
1597+ applyScope = (!event->signalScope ) ? false : true ;
1598+ args.dcFlushEnable = applyScope;
1599+ if (applyScope || event->isEventTimestampFlagSet ()) {
1600+ NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation (
1601+ *commandContainer.getCommandStream (), POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
1602+ ptrOffset (baseAddr, eventSignalOffset), Event::STATE_SIGNALED,
1603+ commandContainer.getDevice ()->getHardwareInfo (),
1604+ args);
1605+ } else {
1606+ using MI_STORE_DATA_IMM = typename GfxFamily::MI_STORE_DATA_IMM;
1607+ MI_STORE_DATA_IMM storeDataImmediate = GfxFamily::cmdInitStoreDataImm;
1608+ storeDataImmediate.setStoreQword (false );
1609+ storeDataImmediate.setDwordLength (MI_STORE_DATA_IMM::DWORD_LENGTH::DWORD_LENGTH_STORE_QWORD);
1610+ storeDataImmediate.setDataDword0 (Event::STATE_SIGNALED);
1611+ auto buffer = commandContainer.getCommandStream ()->template getSpaceForCmd <MI_STORE_DATA_IMM>();
1612+ *buffer = storeDataImmediate;
1613+ }
15831614 }
15841615 return ZE_RESULT_SUCCESS;
15851616}
@@ -1752,7 +1783,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWriteGlobalTimestamp(
17521783 }
17531784
17541785 if (hSignalEvent) {
1755- CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent (hSignalEvent);
1786+ CommandListCoreFamily<gfxCoreFamily>::appendSignalEventPostWalker (hSignalEvent);
17561787 }
17571788
17581789 auto allocationStruct = getAlignedAllocation (this ->device , dstptr, sizeof (uint64_t ));
0 commit comments