@@ -177,7 +177,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
177177 bool isHostSignalScopeEvent = launchParams.isHostSignalScopeEvent ;
178178 bool interruptEvent = false ;
179179 Event *compactEvent = nullptr ;
180- Event *eventForInOrderExec = event;
181180 if (event && !launchParams.makeKernelCommandView ) {
182181 if (kernel->getPrintfBufferAllocation () != nullptr ) {
183182 auto module = static_cast <const ModuleImp *>(&static_cast <KernelImp *>(kernel)->getParentModule ());
@@ -187,7 +186,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
187186 isHostSignalScopeEvent = event->isSignalScope (ZE_EVENT_SCOPE_FLAG_HOST);
188187 if (compactL3FlushEvent (getDcFlushRequired (event->isSignalScope ()))) {
189188 compactEvent = event;
190- event = nullptr ;
191189 } else {
192190 NEO::GraphicsAllocation *eventPoolAlloc = event->getAllocation (this ->device );
193191
@@ -321,31 +319,31 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
321319
322320 if (!launchParams.makeKernelCommandView ) {
323321 inOrderExecSignalRequired = (this ->isInOrderExecutionEnabled () && !launchParams.isKernelSplitOperation && !launchParams.pipeControlSignalling );
324- inOrderNonWalkerSignalling = isInOrderNonWalkerSignalingRequired (eventForInOrderExec );
322+ inOrderNonWalkerSignalling = isInOrderNonWalkerSignalingRequired (event );
325323
326324 if (inOrderExecSignalRequired) {
327325 if (!compactEvent || !compactEvent->isCounterBased () || compactEvent->isEventTimestampFlagSet ()) {
328326 if (inOrderNonWalkerSignalling) {
329- if (!eventForInOrderExec ->getAllocation (this ->device )) {
330- eventForInOrderExec ->resetInOrderTimestampNode (device->getInOrderTimestampAllocator ()->getTag (), this ->partitionCount );
327+ if (!event ->getAllocation (this ->device )) {
328+ event ->resetInOrderTimestampNode (device->getInOrderTimestampAllocator ()->getTag (), this ->partitionCount );
331329 }
332- if (!eventForInOrderExec ->isCounterBased ()) {
333- dispatchEventPostSyncOperation (eventForInOrderExec , nullptr , launchParams.outListCommands , Event::STATE_CLEARED, false , false , false , false , false );
330+ if (!event ->isCounterBased ()) {
331+ dispatchEventPostSyncOperation (event , nullptr , launchParams.outListCommands , Event::STATE_CLEARED, false , false , false , false , false );
334332 } else if (compactEvent) {
335- eventAddress = eventForInOrderExec ->getPacketAddress (this ->device );
333+ eventAddress = event ->getPacketAddress (this ->device );
336334 isTimestampEvent = true ;
337335 if (!launchParams.omitAddingEventResidency ) {
338- commandContainer.addToResidencyContainer (eventForInOrderExec ->getAllocation (this ->device ));
336+ commandContainer.addToResidencyContainer (event ->getAllocation (this ->device ));
339337 }
340338 }
341339 } else {
342340 inOrderCounterValue = this ->inOrderExecInfo ->getCounterValue () + getInOrderIncrementValue ();
343341 inOrderExecInfo = this ->inOrderExecInfo .get ();
344- if (eventForInOrderExec && eventForInOrderExec ->isCounterBased ()) {
342+ if (event && event ->isCounterBased ()) {
345343 isCounterBasedEvent = true ;
346- if (eventForInOrderExec ->getInOrderIncrementValue (this ->partitionCount ) > 0 ) {
347- inOrderIncrementGpuAddress = eventForInOrderExec ->getInOrderExecInfo ()->getBaseDeviceAddress ();
348- inOrderIncrementValue = eventForInOrderExec ->getInOrderIncrementValue (this ->partitionCount );
344+ if (event ->getInOrderIncrementValue (this ->partitionCount ) > 0 ) {
345+ inOrderIncrementGpuAddress = event ->getInOrderExecInfo ()->getBaseDeviceAddress ();
346+ inOrderIncrementValue = event ->getInOrderIncrementValue (this ->partitionCount );
349347 }
350348 }
351349 }
@@ -492,7 +490,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
492490 if (compactEvent->isInterruptModeEnabled ()) {
493491 NEO::EncodeUserInterrupt<GfxFamily>::encode (*commandContainer.getCommandStream ());
494492 }
495- } else if (event) {
493+ } else if (event && ! compactL3FlushEvent ( getDcFlushRequired (event-> isSignalScope ())) ) {
496494 event->setPacketsInUse (partitionCount);
497495
498496 if (l3FlushInPipeControlEnable) {
@@ -507,20 +505,20 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
507505 if (inOrderExecSignalRequired) {
508506 if (inOrderNonWalkerSignalling) {
509507 if (!launchParams.skipInOrderNonWalkerSignaling ) {
510- if (!(eventForInOrderExec ->isCounterBased () && eventForInOrderExec ->isEventTimestampFlagSet ())) {
508+ if (!(event ->isCounterBased () && event ->isEventTimestampFlagSet ())) {
511509 if (compactEvent && compactEvent->isCounterBased ()) {
512510 auto pcCmdPtr = this ->commandContainer .getCommandStream ()->getSpace (0u );
513511 inOrderCounterValue = this ->inOrderExecInfo ->getCounterValue () + getInOrderIncrementValue ();
514- appendSignalInOrderDependencyCounter (eventForInOrderExec , false , true , textureFlushRequired, false );
512+ appendSignalInOrderDependencyCounter (event , false , true , textureFlushRequired, false );
515513 addCmdForPatching (nullptr , pcCmdPtr, nullptr , inOrderCounterValue, NEO::InOrderPatchCommandHelpers::PatchCmdType::pipeControl);
516514 textureFlushRequired = false ;
517515 } else {
518- appendWaitOnSingleEvent (eventForInOrderExec , launchParams.outListCommands , false , false , CommandToPatch::CbEventTimestampPostSyncSemaphoreWait);
519- appendSignalInOrderDependencyCounter (eventForInOrderExec , false , false , false , false );
516+ appendWaitOnSingleEvent (event , launchParams.outListCommands , false , false , CommandToPatch::CbEventTimestampPostSyncSemaphoreWait);
517+ appendSignalInOrderDependencyCounter (event , false , false , false , false );
520518 }
521519 } else {
522520 this ->latestOperationHasOptimizedCbEvent = true ;
523- eventForInOrderExec ->setOptimizedCbEvent (true );
521+ event ->setOptimizedCbEvent (true );
524522 }
525523 }
526524 } else {
0 commit comments