@@ -70,9 +70,7 @@ enum QueueOrder { Ordered, OOO };
70
70
// Implementation of the submission information storage.
71
71
struct SubmissionInfoImpl {
72
72
optional<detail::SubmitPostProcessF> MPostProcessorFunc = std::nullopt;
73
- #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
74
73
std::shared_ptr<detail::queue_impl> MSecondaryQueue = nullptr ;
75
- #endif
76
74
ext::oneapi::experimental::event_mode_enum MEventMode =
77
75
ext::oneapi::experimental::event_mode_enum::none;
78
76
};
@@ -342,11 +340,12 @@ class queue_impl {
342
340
// / group is being enqueued on.
343
341
event submit (const detail::type_erased_cgfo_ty &CGF,
344
342
const std::shared_ptr<queue_impl> &Self,
345
- [[maybe_unused]] const std::shared_ptr<queue_impl> &SecondQueue,
343
+ const std::shared_ptr<queue_impl> &SecondQueue,
346
344
const detail::code_location &Loc, bool IsTopCodeLoc,
347
345
const SubmitPostProcessF *PostProcess = nullptr ) {
348
346
event ResEvent;
349
347
SubmissionInfo SI{};
348
+ SI.SecondaryQueue () = SecondQueue;
350
349
if (PostProcess)
351
350
SI.PostProcessorFunc () = *PostProcess;
352
351
return submit_with_event (CGF, Self, SI, Loc, IsTopCodeLoc);
@@ -365,6 +364,21 @@ class queue_impl {
365
364
const std::shared_ptr<queue_impl> &Self,
366
365
const SubmissionInfo &SubmitInfo,
367
366
const detail::code_location &Loc, bool IsTopCodeLoc) {
367
+ if (SubmitInfo.SecondaryQueue ()) {
368
+ event ResEvent;
369
+ const std::shared_ptr<queue_impl> &SecondQueue =
370
+ SubmitInfo.SecondaryQueue ();
371
+ try {
372
+ ResEvent = submit_impl (CGF, Self, Self, SecondQueue,
373
+ /* CallerNeedsEvent=*/ true , Loc, IsTopCodeLoc,
374
+ SubmitInfo);
375
+ } catch (...) {
376
+ ResEvent = SecondQueue->submit_impl (CGF, SecondQueue, Self, SecondQueue,
377
+ /* CallerNeedsEvent=*/ true , Loc,
378
+ IsTopCodeLoc, SubmitInfo);
379
+ }
380
+ return ResEvent;
381
+ }
368
382
event ResEvent =
369
383
submit_impl (CGF, Self, Self, nullptr ,
370
384
/* CallerNeedsEvent=*/ true , Loc, IsTopCodeLoc, SubmitInfo);
@@ -376,8 +390,21 @@ class queue_impl {
376
390
const SubmissionInfo &SubmitInfo,
377
391
const detail::code_location &Loc,
378
392
bool IsTopCodeLoc) {
379
- submit_impl (CGF, Self, Self, nullptr , /* CallerNeedsEvent=*/ false , Loc,
380
- IsTopCodeLoc, SubmitInfo);
393
+ if (SubmitInfo.SecondaryQueue ()) {
394
+ const std::shared_ptr<queue_impl> SecondQueue =
395
+ SubmitInfo.SecondaryQueue ();
396
+ try {
397
+ submit_impl (CGF, Self, Self, SecondQueue,
398
+ /* CallerNeedsEvent=*/ false , Loc, IsTopCodeLoc, SubmitInfo);
399
+ } catch (...) {
400
+ SecondQueue->submit_impl (CGF, SecondQueue, Self, SecondQueue,
401
+ /* CallerNeedsEvent=*/ false , Loc, IsTopCodeLoc,
402
+ SubmitInfo);
403
+ }
404
+ } else {
405
+ submit_impl (CGF, Self, Self, nullptr , /* CallerNeedsEvent=*/ false , Loc,
406
+ IsTopCodeLoc, SubmitInfo);
407
+ }
381
408
}
382
409
383
410
// / Performs a blocking wait for the completion of all enqueued tasks in the
0 commit comments