Skip to content

Commit 18cebb5

Browse files
Workaround
1 parent 51ca072 commit 18cebb5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
312312
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
313313
detail::handler_impl HandlerImplVal(SecondaryQueue, CallerNeedsEvent);
314314
detail::handler_impl *HandlerImpl = &HandlerImplVal;
315-
handler Handler(HandlerImpl, shared_from_this());
315+
// Inlining `Self` results in a crash when SYCL RT is built using MSVC with
316+
// optimizations enabled. No crash if built using OneAPI.
317+
auto Self = shared_from_this();
318+
handler Handler(HandlerImpl, Self);
316319
#else
317320
handler Handler(shared_from_this(), SecondaryQueue, CallerNeedsEvent);
318321
auto &HandlerImpl = detail::getSyclObjImpl(Handler);

0 commit comments

Comments
 (0)