Skip to content

Commit 37fd1cc

Browse files
[SYCL] Remove secondary queue from submit info DS (#18045)
Follow up of #17967 Secondary submission queue is optional in SYCL Spec and it has been decided to remove it.
1 parent d466092 commit 37fd1cc

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

sycl/include/sycl/queue.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ class __SYCL_EXPORT SubmissionInfo {
8686
sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc();
8787
const sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc() const;
8888

89+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
8990
std::shared_ptr<detail::queue_impl> &SecondaryQueue();
9091
const std::shared_ptr<detail::queue_impl> &SecondaryQueue() const;
92+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
9193

9294
ext::oneapi::experimental::event_mode_enum &EventMode();
9395
const ext::oneapi::experimental::event_mode_enum &EventMode() const;
@@ -3618,13 +3620,11 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36183620
template <bool UseFallbackAssert, typename PropertiesT>
36193621
event submit_with_event(
36203622
PropertiesT Props, const detail::type_erased_cgfo_ty &CGF,
3621-
queue *SecondaryQueuePtr,
3623+
[[maybe_unused]] queue *SecondaryQueuePtr,
36223624
const detail::code_location &CodeLoc = detail::code_location::current()) {
36233625
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
36243626
detail::SubmissionInfo SI{};
36253627
ProcessSubmitProperties(Props, SI);
3626-
if (SecondaryQueuePtr)
3627-
SI.SecondaryQueue() = detail::getSyclObjImpl(*SecondaryQueuePtr);
36283628
if constexpr (UseFallbackAssert)
36293629
SI.PostProcessorFunc() =
36303630
[this, &SecondaryQueuePtr,

sycl/source/detail/queue_impl.hpp

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ enum QueueOrder { Ordered, OOO };
7070
// Implementation of the submission information storage.
7171
struct SubmissionInfoImpl {
7272
optional<detail::SubmitPostProcessF> MPostProcessorFunc = std::nullopt;
73+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
7374
std::shared_ptr<detail::queue_impl> MSecondaryQueue = nullptr;
75+
#endif
7476
ext::oneapi::experimental::event_mode_enum MEventMode =
7577
ext::oneapi::experimental::event_mode_enum::none;
7678
};
@@ -340,12 +342,11 @@ class queue_impl {
340342
/// group is being enqueued on.
341343
event submit(const detail::type_erased_cgfo_ty &CGF,
342344
const std::shared_ptr<queue_impl> &Self,
343-
const std::shared_ptr<queue_impl> &SecondQueue,
345+
[[maybe_unused]] const std::shared_ptr<queue_impl> &SecondQueue,
344346
const detail::code_location &Loc, bool IsTopCodeLoc,
345347
const SubmitPostProcessF *PostProcess = nullptr) {
346348
event ResEvent;
347349
SubmissionInfo SI{};
348-
SI.SecondaryQueue() = SecondQueue;
349350
if (PostProcess)
350351
SI.PostProcessorFunc() = *PostProcess;
351352
return submit_with_event(CGF, Self, SI, Loc, IsTopCodeLoc);
@@ -364,21 +365,6 @@ class queue_impl {
364365
const std::shared_ptr<queue_impl> &Self,
365366
const SubmissionInfo &SubmitInfo,
366367
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-
}
382368
event ResEvent =
383369
submit_impl(CGF, Self, Self, nullptr,
384370
/*CallerNeedsEvent=*/true, Loc, IsTopCodeLoc, SubmitInfo);
@@ -390,21 +376,8 @@ class queue_impl {
390376
const SubmissionInfo &SubmitInfo,
391377
const detail::code_location &Loc,
392378
bool IsTopCodeLoc) {
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-
}
379+
submit_impl(CGF, Self, Self, nullptr, /*CallerNeedsEvent=*/false, Loc,
380+
IsTopCodeLoc, SubmitInfo);
408381
}
409382

410383
/// Performs a blocking wait for the completion of all enqueued tasks in the

sycl/source/queue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const optional<SubmitPostProcessF> &SubmissionInfo::PostProcessorFunc() const {
3232
return impl->MPostProcessorFunc;
3333
}
3434

35+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
3536
std::shared_ptr<detail::queue_impl> &SubmissionInfo::SecondaryQueue() {
3637
return impl->MSecondaryQueue;
3738
}
@@ -40,6 +41,7 @@ const std::shared_ptr<detail::queue_impl> &
4041
SubmissionInfo::SecondaryQueue() const {
4142
return impl->MSecondaryQueue;
4243
}
44+
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
4345

4446
ext::oneapi::experimental::event_mode_enum &SubmissionInfo::EventMode() {
4547
return impl->MEventMode;

0 commit comments

Comments
 (0)