@@ -549,6 +549,13 @@ graph_impl::add(std::shared_ptr<dynamic_command_group_impl> &DynCGImpl,
549549 return NodeImpl;
550550}
551551
552+ std::weak_ptr<sycl::detail::queue_impl> graph_impl::getQueue () const {
553+ std::weak_ptr<sycl::detail::queue_impl> Return{};
554+ if (!MRecordingQueues.empty ())
555+ Return = *(MRecordingQueues.begin ());
556+ return Return;
557+ }
558+
552559void graph_impl::addQueue (sycl::detail::queue_impl &RecordingQueue) {
553560 MRecordingQueues.insert (RecordingQueue.weak_from_this ());
554561}
@@ -870,7 +877,7 @@ void exec_graph_impl::createCommandBuffers(
870877exec_graph_impl::exec_graph_impl (sycl::context Context,
871878 const std::shared_ptr<graph_impl> &GraphImpl,
872879 const property_list &PropList)
873- : MSchedule(), MGraphImpl(GraphImpl), MSyncPoints(), MQueueImpl(),
880+ : MSchedule(), MGraphImpl(GraphImpl), MSyncPoints(),
874881 MDevice (GraphImpl->getDevice ()), MContext(Context), MRequirements(),
875882 MSchedulerDependencies(),
876883 MIsUpdatable(PropList.has_property<property::graph::updatable>()),
@@ -890,6 +897,15 @@ exec_graph_impl::exec_graph_impl(sycl::context Context,
890897 }
891898 // Copy nodes from GraphImpl and merge any subgraph nodes into this graph.
892899 duplicateNodes ();
900+
901+ if (auto PlaceholderQueuePtr = GraphImpl->getQueue ().lock ()) {
902+ MQueueImpl = PlaceholderQueuePtr;
903+ } else {
904+ MQueueImpl = sycl::detail::queue_impl::create (
905+ *sycl::detail::getSyclObjImpl (GraphImpl->getDevice ()),
906+ *sycl::detail::getSyclObjImpl (Context), sycl::async_handler{},
907+ sycl::property_list{});
908+ }
893909}
894910
895911exec_graph_impl::~exec_graph_impl () {
0 commit comments