diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index dc864aeb9e77..9737d225048f 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -624,7 +624,7 @@ EventImplPtr queue_impl::submit_graph_direct_impl( detail::CGType::ExecCommandBuffer), /*SchedulerBypass*/ false}; } else { - return ExecGraph->enqueue(*this, CGData, EventNeeded); + return ExecGraph->enqueue(*this, std::move(CGData), EventNeeded); } }; // If the graph contains a host task, we may need to insert a barrier prior diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 2dbd430c6b38..92ed818d5870 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -377,8 +377,8 @@ class queue_impl : public std::enable_shared_from_this { } void submit_graph_direct_without_event( - std::shared_ptr - ExecGraph, + const std::shared_ptr + &ExecGraph, sycl::span DepEvents, const detail::code_location &CodeLoc, bool IsTopCodeLoc) { submit_graph_direct_impl(ExecGraph, false, DepEvents, CodeLoc, @@ -386,8 +386,8 @@ class queue_impl : public std::enable_shared_from_this { } event submit_graph_direct_with_event( - std::shared_ptr - ExecGraph, + const std::shared_ptr + &ExecGraph, sycl::span DepEvents, const detail::code_location &CodeLoc, bool IsTopCodeLoc) { return createSyclObjFromImpl(submit_graph_direct_impl(