diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index 01a54347bfdba..f308a769daaad 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -370,63 +370,14 @@ event queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, #ifndef __INTEL_PREVIEW_BREAKING_CHANGES event queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, const std::shared_ptr &Self, - const std::shared_ptr &PrimaryQueue, + const std::shared_ptr &, const std::shared_ptr &SecondaryQueue, bool CallerNeedsEvent, const detail::code_location &Loc, bool IsTopCodeLoc, const SubmissionInfo &SubmitInfo) { -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - detail::handler_impl HandlerImplVal(PrimaryQueue.get(), CallerNeedsEvent); - detail::handler_impl *HandlerImpl = &HandlerImplVal; - handler Handler(HandlerImpl, Self); -#else - handler Handler(Self, CallerNeedsEvent); - auto &HandlerImpl = detail::getSyclObjImpl(Handler); -#endif - -#if XPTI_ENABLE_INSTRUMENTATION - if (xptiTraceEnabled()) { - Handler.saveCodeLoc(Loc, IsTopCodeLoc); - } -#endif - - { - NestedCallsTracker tracker; - CGF(Handler); - } - - // Scheduler will later omit events, that are not required to execute tasks. - // Host and interop tasks, however, are not submitted to low-level runtimes - // and require separate dependency management. - const CGType Type = HandlerImpl->MCGType; - std::vector Streams; - if (Type == CGType::Kernel) - Streams = std::move(Handler.MStreamStorage); - - HandlerImpl->MEventMode = SubmitInfo.EventMode(); - - auto Event = finalizeHandler(Handler, SubmitInfo.PostProcessorFunc()); - - addEvent(Event); - - const auto &EventImpl = detail::getSyclObjImpl(Event); - for (auto &Stream : Streams) { - // We don't want stream flushing to be blocking operation that is why submit - // a host task to print stream buffer. It will fire up as soon as the kernel - // finishes execution. - auto L = [&](handler &ServiceCGH) { - Stream->generateFlushCommand(ServiceCGH); - }; - detail::type_erased_cgfo_ty CGF{L}; - event FlushEvent = - submit_impl(CGF, Self, PrimaryQueue, SecondaryQueue, - /*CallerNeedsEvent*/ true, Loc, IsTopCodeLoc, {}); - EventImpl->attachEventToCompleteWeak(detail::getSyclObjImpl(FlushEvent)); - registerStreamServiceEvent(detail::getSyclObjImpl(FlushEvent)); - } - - return Event; + return submit_impl(CGF, Self, SecondaryQueue.get(), CallerNeedsEvent, Loc, + IsTopCodeLoc, SubmitInfo); } #endif