@@ -424,28 +424,23 @@ template <int Dims> bool range_size_fits_in_size_t(const range<Dims> &r) {
424424// / \ingroup sycl_api
425425class __SYCL_EXPORT handler {
426426private:
427+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
428+ // / Constructs SYCL handler from the pre-constructed stack-allocated
429+ // / `handler_impl` (not enforced, but meaningless to do a heap allocation
430+ // / outside handler instance).
431+ // /
432+ // / \param HandlerImpl is a pre-constructed handler_impl.
433+ //
434+ // Can't provide this overload outside preview because `handler` lacks
435+ // required data members.
436+ handler (detail::handler_impl &HandlerImpl);
437+ #else
427438 // / Constructs SYCL handler from queue.
428439 // /
429440 // / \param Queue is a SYCL queue.
430441 // / \param CallerNeedsEvent indicates if the event resulting from this handler
431442 // / is needed by the caller.
432- #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
433- handler (const std::shared_ptr<detail::queue_impl> &Queue,
434- bool CallerNeedsEvent);
435- #else
436443 handler (std::shared_ptr<detail::queue_impl> Queue, bool CallerNeedsEvent);
437- #endif
438-
439- #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
440- // / Constructs SYCL handler from the pre-constructed handler_impl and the
441- // / associated queue. Inside of Graph implementation, the Queue value is not
442- // / used, for those cases it can be initialized with an empty shared_ptr.
443- // /
444- // / \param HandlerImpl is a pre-constructed handler_impl.
445- // / \param Queue is a SYCL queue.
446- handler (detail::handler_impl *HandlerImpl,
447- const std::shared_ptr<detail::queue_impl> &Queue);
448- #else
449444 // / Constructs SYCL handler from the associated queue and the submission's
450445 // / primary and secondary queue.
451446 // /
@@ -456,20 +451,14 @@ class __SYCL_EXPORT handler {
456451 // / is null if no secondary queue is associated with the submission.
457452 // / \param CallerNeedsEvent indicates if the event resulting from this handler
458453 // / is needed by the caller.
459- #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
460- // TODO: This function is not used anymore, remove it in the next
461- // ABI-breaking window.
462454 handler (std::shared_ptr<detail::queue_impl> Queue,
463455 std::shared_ptr<detail::queue_impl> PrimaryQueue,
464456 std::shared_ptr<detail::queue_impl> SecondaryQueue,
465457 bool CallerNeedsEvent);
466- #endif
467458 __SYCL_DLL_LOCAL handler (std::shared_ptr<detail::queue_impl> Queue,
468459 detail::queue_impl *SecondaryQueue,
469460 bool CallerNeedsEvent);
470- #endif
471461
472- #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
473462 // / Constructs SYCL handler from Graph.
474463 // /
475464 // / The handler will add the command-group as a node to the graph rather than
@@ -3368,16 +3357,15 @@ class __SYCL_EXPORT handler {
33683357
33693358private:
33703359#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3371- // In some cases we need to construct handler_impl in heap. Sole propose
3372- // of MImplOwner is to destroy handler_impl in destructor of handler.
3373- // Can't use unique_ptr because declaration of handler_impl is not available
3374- // in this header.
3375- std::shared_ptr<detail::handler_impl> MImplOwner;
3360+ // TODO: Maybe make it a reference when non-preview branch is removed.
3361+ // On the other hand, see `HandlerAccess:postProcess` to how `swap_impl` might
3362+ // be useful in future, pointer here would make that possible/easier.
33763363 detail::handler_impl *impl;
3377- const std::shared_ptr<detail::queue_impl> &MQueue;
33783364#else
33793365 std::shared_ptr<detail::handler_impl> impl;
3380- std::shared_ptr<detail::queue_impl> MQueue;
3366+
3367+ // Use impl->get_queue*() instead:
3368+ std::shared_ptr<detail::queue_impl> MQueueDoNotUse;
33813369#endif
33823370 std::vector<detail::LocalAccessorImplPtr> MLocalAccStorage;
33833371 std::vector<std::shared_ptr<detail::stream_impl>> MStreamStorage;
0 commit comments