diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp index 931816551d95e..666adcc2dbb9b 100644 --- a/sycl/source/detail/graph_impl.cpp +++ b/sycl/source/detail/graph_impl.cpp @@ -139,7 +139,7 @@ void propagatePartitionUp(std::shared_ptr Node, int PartitionNum) { /// @param HostTaskList List of host tasks that have already been processed and /// are encountered as successors to the node Node. void propagatePartitionDown( - std::shared_ptr Node, int PartitionNum, + const std::shared_ptr &Node, int PartitionNum, std::list> &HostTaskList) { if (Node->MCGType == sycl::detail::CGType::CodeplayHostTask) { if (Node->MPartitionNum != -1) { @@ -753,7 +753,7 @@ std::vector graph_impl::getExitNodesEvents( } void graph_impl::beginRecording( - std::shared_ptr Queue) { + const std::shared_ptr &Queue) { graph_impl::WriteLock Lock(MMutex); if (!Queue->hasCommandGraph()) { Queue->setCommandGraph(shared_from_this()); @@ -1024,9 +1024,10 @@ exec_graph_impl::enqueue(const std::shared_ptr &Queue, for (std::vector::iterator It = MExecutionEvents.begin(); It != MExecutionEvents.end();) { - auto Event = *It; + EventImplPtr &Event = *It; if (!Event->isCompleted()) { - auto &AttachedEventsList = Event->getPostCompleteEvents(); + const std::vector &AttachedEventsList = + Event->getPostCompleteEvents(); CGData.MEvents.reserve(CGData.MEvents.size() + AttachedEventsList.size() + 1); CGData.MEvents.push_back(Event); diff --git a/sycl/source/detail/graph_impl.hpp b/sycl/source/detail/graph_impl.hpp index 1600b76f7b991..1e585180152f5 100644 --- a/sycl/source/detail/graph_impl.hpp +++ b/sycl/source/detail/graph_impl.hpp @@ -895,7 +895,7 @@ class graph_impl : public std::enable_shared_from_this { /// @param EventImpl Event to associate with a node in map. /// @param NodeImpl Node to associate with event in map. void addEventForNode(std::shared_ptr EventImpl, - std::shared_ptr NodeImpl) { + const std::shared_ptr &NodeImpl) { if (!(EventImpl->hasCommandGraph())) EventImpl->setCommandGraph(shared_from_this()); MEventsMap[EventImpl] = NodeImpl; @@ -1145,7 +1145,7 @@ class graph_impl : public std::enable_shared_from_this { /// Sets the Queue state to queue_state::recording. Adds the queue to the list /// of recording queues associated with this graph. /// @param[in] Queue The queue to be recorded from. - void beginRecording(std::shared_ptr Queue); + void beginRecording(const std::shared_ptr &Queue); /// Store the last barrier node that was submitted to the queue. /// @param[in] Queue The queue the barrier was recorded from. @@ -1212,7 +1212,7 @@ class graph_impl : public std::enable_shared_from_this { /// added as a root node. /// @param Node The node to add deps for /// @param Deps List of dependent nodes - void addDepsToNode(std::shared_ptr Node, + void addDepsToNode(const std::shared_ptr &Node, std::vector> &Deps) { if (!Deps.empty()) { for (auto &N : Deps) {