From 1256f9b16a4624fbfd5343af0b5f8081fa896ef1 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 27 Aug 2025 07:44:45 -0700 Subject: [PATCH 1/2] [SYCL] Fix stale handler_impl reference issue with reductions --- sycl/source/detail/queue_impl.cpp | 6 +++++- sycl/test-e2e/Reduction/lit.local.cfg | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 sycl/test-e2e/Reduction/lit.local.cfg diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index 466a314939024..e2f55ba8a122d 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -333,7 +333,6 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, #else handler Handler(shared_from_this(), CallerNeedsEvent); #endif - detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl(Handler); #ifdef XPTI_ENABLE_INSTRUMENTATION if (xptiTraceEnabled()) { @@ -346,6 +345,11 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, CGF(Handler); } + + // We might swap handlers as part of the CGH(Handler) call in the reduction + // case, so need to retrieve the handler_impl reference after that. + detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl(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. diff --git a/sycl/test-e2e/Reduction/lit.local.cfg b/sycl/test-e2e/Reduction/lit.local.cfg deleted file mode 100644 index 6b085324f1c83..0000000000000 --- a/sycl/test-e2e/Reduction/lit.local.cfg +++ /dev/null @@ -1,4 +0,0 @@ -# https://github.com/intel/llvm/issues/19680 -# https://github.com/intel/llvm/issues/19767 -if 'run-mode' in config.available_features: - config.unsupported_features += ['true'] From 212daf19ee25cf3eb10ae0d3cc1b1358ab9bad1d Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 27 Aug 2025 07:53:21 -0700 Subject: [PATCH 2/2] Appease clang-format --- sycl/source/detail/queue_impl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index e2f55ba8a122d..a107ee491dfe3 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -345,7 +345,6 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, CGF(Handler); } - // We might swap handlers as part of the CGH(Handler) call in the reduction // case, so need to retrieve the handler_impl reference after that. detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl(Handler);