@@ -77,6 +77,7 @@ inline event submitAssertCapture(queue &, event &, queue *,
7777// event &Event - event after which post processing should be executed
7878using SubmitPostProcessF = std::function<void (bool , bool , event &)>;
7979
80+ #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
8081struct SubmissionInfoImpl ;
8182
8283class __SYCL_EXPORT SubmissionInfo {
@@ -95,6 +96,60 @@ class __SYCL_EXPORT SubmissionInfo {
9596private:
9697 std::shared_ptr<SubmissionInfoImpl> impl = nullptr ;
9798};
99+ #endif
100+
101+ namespace v1 {
102+
103+ // This class is a part of the ABI, so it's moved to a separate namespace to
104+ // simplify changes.
105+ // To perform non-ABI breaking changes:
106+ // * namespace v(N+1) can be added,
107+ // * functions that use SubmissionInfo and are NOT part of the ABI should be
108+ // switched to use v(N+1) namespace,
109+ // * functions that use SubmissionInfo and are part of the ABI should be
110+ // overloaded with a new variant using v(N+1) namespace,
111+ // * old namespace vN should be moved under #ifndef
112+ // __INTEL_PREVIEW_BREAKING_CHANGES guard.
113+ // TODO: inline namespace can be employed here after SubmissionInfo removed from
114+ // the enclosing scope.
115+
116+ class __SYCL_EXPORT SubmissionInfo {
117+ public:
118+ SubmissionInfo () {}
119+
120+ #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
121+ SubmissionInfo (const detail::SubmissionInfo &SI)
122+ : MPostProcessorFunc(SI.PostProcessorFunc()),
123+ MSecondaryQueue(SI.SecondaryQueue()), MEventMode(SI.EventMode()) {}
124+ #endif
125+
126+ sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc () {
127+ return MPostProcessorFunc;
128+ }
129+ const sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc () const {
130+ return MPostProcessorFunc;
131+ }
132+
133+ std::shared_ptr<detail::queue_impl> &SecondaryQueue () {
134+ return MSecondaryQueue;
135+ }
136+ const std::shared_ptr<detail::queue_impl> &SecondaryQueue () const {
137+ return MSecondaryQueue;
138+ }
139+
140+ ext::oneapi::experimental::event_mode_enum &EventMode () { return MEventMode; }
141+ const ext::oneapi::experimental::event_mode_enum &EventMode () const {
142+ return MEventMode;
143+ }
144+
145+ private:
146+ optional<detail::SubmitPostProcessF> MPostProcessorFunc = std::nullopt ;
147+ std::shared_ptr<detail::queue_impl> MSecondaryQueue = nullptr ;
148+ ext::oneapi::experimental::event_mode_enum MEventMode =
149+ ext::oneapi::experimental::event_mode_enum::none;
150+ };
151+
152+ } // namespace v1
98153} // namespace detail
99154
100155namespace ext ::oneapi ::experimental {
@@ -3534,7 +3589,8 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35343589 const sycl::detail::code_location &CodeLoc);
35353590
35363591 template <typename PropertiesT>
3537- void ProcessSubmitProperties (PropertiesT Props, detail::SubmissionInfo &SI) {
3592+ void ProcessSubmitProperties (PropertiesT Props,
3593+ detail::v1::SubmissionInfo &SI) {
35383594 if constexpr (Props.template has_property <
35393595 ext::oneapi::experimental::event_mode_key>()) {
35403596 ext::oneapi::experimental::event_mode EventModeProp =
@@ -3589,17 +3645,25 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35893645 const detail::SubmissionInfo &SubmitInfo,
35903646 const detail::code_location &CodeLoc,
35913647 bool IsTopCodeLoc);
3648+ event submit_with_event_impl (const detail::type_erased_cgfo_ty &CGH,
3649+ const detail::SubmissionInfo &SubmitInfo,
3650+ const detail::code_location &CodeLoc,
3651+ bool IsTopCodeLoc);
3652+ void submit_without_event_impl (const detail::type_erased_cgfo_ty &CGH,
3653+ const detail::SubmissionInfo &SubmitInfo,
3654+ const detail::code_location &CodeLoc,
3655+ bool IsTopCodeLoc);
35923656#endif // __INTEL_PREVIEW_BREAKING_CHANGES
35933657
35943658 // / A template-free versions of submit.
35953659 event submit_with_event_impl (const detail::type_erased_cgfo_ty &CGH,
3596- const detail::SubmissionInfo &SubmitInfo,
3660+ const detail::v1:: SubmissionInfo &SubmitInfo,
35973661 const detail::code_location &CodeLoc,
35983662 bool IsTopCodeLoc);
35993663
36003664 // / A template-free version of submit_without_event.
36013665 void submit_without_event_impl (const detail::type_erased_cgfo_ty &CGH,
3602- const detail::SubmissionInfo &SubmitInfo,
3666+ const detail::v1:: SubmissionInfo &SubmitInfo,
36033667 const detail::code_location &CodeLoc,
36043668 bool IsTopCodeLoc);
36053669
@@ -3621,7 +3685,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36213685 queue *SecondaryQueuePtr,
36223686 const detail::code_location &CodeLoc = detail::code_location::current()) {
36233687 detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
3624- detail::SubmissionInfo SI{};
3688+ detail::v1:: SubmissionInfo SI{};
36253689 ProcessSubmitProperties (Props, SI);
36263690 if (SecondaryQueuePtr)
36273691 SI.SecondaryQueue () = detail::getSyclObjImpl (*SecondaryQueuePtr);
@@ -3659,7 +3723,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36593723 PropertiesT Props, const detail::type_erased_cgfo_ty &CGF,
36603724 const detail::code_location &CodeLoc = detail::code_location::current()) {
36613725 detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
3662- detail::SubmissionInfo SI{};
3726+ detail::v1:: SubmissionInfo SI{};
36633727 ProcessSubmitProperties (Props, SI);
36643728 if constexpr (UseFallbackAssert)
36653729 SI.PostProcessorFunc () = [this , &TlsCodeLocCapture](bool IsKernel,
@@ -3698,7 +3762,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36983762 submit_with_event<UseFallbackAssert>(Props, CGF, CodeLoc);
36993763 } else {
37003764 detail::tls_code_loc_t TlsCodeLocCapture (CodeLoc);
3701- detail::SubmissionInfo SI{};
3765+ detail::v1:: SubmissionInfo SI{};
37023766 ProcessSubmitProperties (Props, SI);
37033767 submit_without_event_impl (CGF, SI, TlsCodeLocCapture.query (),
37043768 TlsCodeLocCapture.isToplevel ());
0 commit comments