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..4b17a8206488 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -381,7 +381,7 @@ class queue_impl : public std::enable_shared_from_this { ExecGraph, sycl::span DepEvents, const detail::code_location &CodeLoc, bool IsTopCodeLoc) { - submit_graph_direct_impl(ExecGraph, false, DepEvents, CodeLoc, + submit_graph_direct_impl(std::move(ExecGraph), false, DepEvents, CodeLoc, IsTopCodeLoc); } @@ -391,7 +391,7 @@ class queue_impl : public std::enable_shared_from_this { sycl::span DepEvents, const detail::code_location &CodeLoc, bool IsTopCodeLoc) { return createSyclObjFromImpl(submit_graph_direct_impl( - ExecGraph, true, DepEvents, CodeLoc, IsTopCodeLoc)); + std::move(ExecGraph), true, DepEvents, CodeLoc, IsTopCodeLoc)); } void submit_without_event(const detail::type_erased_cgfo_ty &CGF,