@@ -90,13 +90,15 @@ inline event submitAssertCapture(queue &, event &, queue *,
9090// event &Event - event after which post processing should be executed
9191using SubmitPostProcessF = std::function<void (bool , bool , event &)>;
9292
93- class SubmissionInfoImpl ;
93+ struct SubmissionInfoImpl ;
9494
95- class SubmissionInfo {
95+ class __SYCL_EXPORT SubmissionInfo {
9696public:
9797 SubmissionInfo () = default ;
9898
9999 void SetPostProcessing (const SubmitPostProcessF &PostProcessorFunc);
100+ void
101+ SetSecondaryQueue (const std::shared_ptr<detail::queue_impl> &SecondaryQueue);
100102
101103 std::shared_ptr<SubmissionInfoImpl> impl = nullptr ;
102104};
@@ -359,8 +361,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
359361 std::enable_if_t <std::is_invocable_r_v<void , T, handler &>, event> submit (
360362 T CGF,
361363 const detail::code_location &CodeLoc = detail::code_location::current()) {
362- return submit_with_event (
363- CGF, /* SecondaryQueuePtr=*/ nullptr , CodeLoc);
364+ return submit_with_event (CGF, /* SecondaryQueuePtr=*/ nullptr , CodeLoc);
364365 }
365366
366367 // / Submits a command group function object to the queue, in order to be
@@ -378,8 +379,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
378379 std::enable_if_t <std::is_invocable_r_v<void , T, handler &>, event> submit (
379380 T CGF, queue &SecondaryQueue,
380381 const detail::code_location &CodeLoc = detail::code_location::current()) {
381- return submit_with_event (
382- CGF, &SecondaryQueue, CodeLoc);
382+ return submit_with_event (CGF, &SecondaryQueue, CodeLoc);
383383 }
384384
385385 // / Prevents any commands submitted afterward to this queue from executing
@@ -2799,13 +2799,15 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
27992799 template <typename T>
28002800 std::enable_if_t <std::is_invocable_r_v<void , T, handler &>, event>
28012801 submit_with_event (
2802- T CGF, [[maybe_unused]] queue *SecondaryQueuePtr,
2802+ T CGF, queue *SecondaryQueuePtr,
28032803 const detail::code_location &CodeLoc = detail::code_location::current()) {
28042804 detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
28052805 detail::SubmissionInfo SI{};
2806+ if (SecondaryQueuePtr)
2807+ SI.SetSecondaryQueue (detail::getSyclObjImpl (*SecondaryQueuePtr));
28062808#if __SYCL_USE_FALLBACK_ASSERT
2807- auto PostProcess = [this , &SecondaryQueuePtr, &TlsCodeLocCapture](
2808- bool IsKernel, bool KernelUsesAssert, event &E) {
2809+ SI. SetPostProcessing ( [this , &SecondaryQueuePtr, &TlsCodeLocCapture](
2810+ bool IsKernel, bool KernelUsesAssert, event &E) {
28092811 if (IsKernel && !device_has (aspect::ext_oneapi_native_assert) &&
28102812 KernelUsesAssert && !device_has (aspect::accelerator)) {
28112813 // __devicelib_assert_fail isn't supported by Device-side Runtime
@@ -2815,8 +2817,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
28152817 submitAssertCapture (*this , E, SecondaryQueuePtr,
28162818 TlsCodeLocCapture.query ());
28172819 }
2818- };
2819- SI.SetPostProcessing (std::move (PostProcess));
2820+ });
28202821#endif // __SYCL_USE_FALLBACK_ASSERT
28212822 return submit_with_event_impl (CGF, SI, TlsCodeLocCapture.query (),
28222823 TlsCodeLocCapture.isToplevel ());
@@ -3063,10 +3064,8 @@ event submitAssertCapture(queue &Self, event &Event, queue *SecondaryQueue,
30633064 });
30643065 };
30653066
3066- CopierEv = Self.submit_with_event (
3067- CopierCGF, SecondaryQueue, CodeLoc);
3068- CheckerEv = Self.submit_with_event (
3069- CheckerCGF, SecondaryQueue, CodeLoc);
3067+ CopierEv = Self.submit_with_event (CopierCGF, SecondaryQueue, CodeLoc);
3068+ CheckerEv = Self.submit_with_event (CheckerCGF, SecondaryQueue, CodeLoc);
30703069
30713070 return CheckerEv;
30723071}
0 commit comments