@@ -373,8 +373,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
373373 const detail::code_location &CodeLoc = detail::code_location::current()) {
374374 return submit_with_event<__SYCL_USE_FALLBACK_ASSERT>(
375375 sycl::ext::oneapi::experimental::empty_properties_t {},
376- detail::type_erased_cgfo_ty{CGF },
377- /* SecondaryQueuePtr=*/ nullptr , CodeLoc);
376+ detail::type_erased_cgfo_ty{CGF }, CodeLoc);
378377 }
379378
380379 // / Submits a command group function object to the queue, in order to be
@@ -3609,6 +3608,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36093608 // /
36103609 // / \param Props is a property list with submission properties.
36113610 // / \param CGF is a function object containing command group.
3611+ // / \param SecondaryQueuePtr is a pointer to the secondary queue.
36123612 // / \param CodeLoc is the code location of the submit call (default argument)
36133613 // / \return a SYCL event object for the submitted command group.
36143614 //
@@ -3643,6 +3643,41 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36433643 TlsCodeLocCapture.isToplevel ());
36443644 }
36453645
3646+ // / Submits a command group function object to the queue, in order to be
3647+ // / scheduled for execution on the device.
3648+ // /
3649+ // / \param Props is a property list with submission properties.
3650+ // / \param CGF is a function object containing command group.
3651+ // / \param CodeLoc is the code location of the submit call (default argument)
3652+ // / \return a SYCL event object for the submitted command group.
3653+ //
3654+ // UseFallBackAssert as template param vs `#if` in function body is necessary
3655+ // to prevent ODR-violation between TUs built with different fallback assert
3656+ // modes.
3657+ template <bool UseFallbackAssert, typename PropertiesT>
3658+ event submit_with_event (
3659+ PropertiesT Props, const detail::type_erased_cgfo_ty &CGF ,
3660+ const detail::code_location &CodeLoc = detail::code_location::current()) {
3661+ detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
3662+ detail::SubmissionInfo SI {};
3663+ ProcessSubmitProperties (Props, SI );
3664+ if constexpr (UseFallbackAssert)
3665+ SI .PostProcessorFunc () = [this , &TlsCodeLocCapture](bool IsKernel,
3666+ bool KernelUsesAssert,
3667+ event &E) {
3668+ if (IsKernel && !device_has (aspect::ext_oneapi_native_assert) &&
3669+ KernelUsesAssert && !device_has (aspect::accelerator)) {
3670+ // __devicelib_assert_fail isn't supported by Device-side Runtime
3671+ // Linking against fallback impl of __devicelib_assert_fail is
3672+ // performed by program manager class
3673+ // Fallback assert isn't supported for FPGA
3674+ submitAssertCapture (*this , E, nullptr , TlsCodeLocCapture.query ());
3675+ }
3676+ };
3677+ return submit_with_event_impl (CGF , SI , TlsCodeLocCapture.query (),
3678+ TlsCodeLocCapture.isToplevel ());
3679+ }
3680+
36463681 // / Submits a command group function object to the queue, in order to be
36473682 // / scheduled for execution on the device.
36483683 // /
@@ -3660,7 +3695,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36603695 if constexpr (UseFallbackAssert) {
36613696 // If post-processing is needed, fall back to the regular submit.
36623697 // TODO: Revisit whether we can avoid this.
3663- submit_with_event<UseFallbackAssert>(Props, CGF , nullptr , CodeLoc);
3698+ submit_with_event<UseFallbackAssert>(Props, CGF , CodeLoc);
36643699 } else {
36653700 detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
36663701 detail::SubmissionInfo SI {};
0 commit comments