File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,6 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
313313#else
314314 handler Handler (shared_from_this (), SecondaryQueue, CallerNeedsEvent);
315315#endif
316- detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl (Handler);
317316
318317#ifdef XPTI_ENABLE_INSTRUMENTATION
319318 if (xptiTraceEnabled ()) {
@@ -326,6 +325,10 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
326325 CGF (Handler);
327326 }
328327
328+ // We might swap handlers as part of the CGH(Handler) call in the reduction
329+ // case, so need to retrieve the handler_impl reference after that.
330+ detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl (Handler);
331+
329332 // Scheduler will later omit events, that are not required to execute tasks.
330333 // Host and interop tasks, however, are not submitted to low-level runtimes
331334 // and require separate dependency management.
You can’t perform that action at this time.
0 commit comments