diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp index 6d59b47fda71d..3382e65328322 100644 --- a/sycl/source/detail/graph_impl.cpp +++ b/sycl/source/detail/graph_impl.cpp @@ -155,7 +155,7 @@ graph_impl::add(const std::vector Events) { std::vector> Deps; // Add any nodes specified by event dependencies into the dependency list - for (auto Dep : Events) { + for (const auto &Dep : Events) { if (auto NodeImpl = MEventsMap.find(Dep); NodeImpl != MEventsMap.end()) { Deps.push_back(NodeImpl->second); } else { @@ -312,7 +312,7 @@ void exec_graph_impl::createCommandBuffers(sycl::device Device) { MPiCommandBuffers[Device] = OutCommandBuffer; // TODO extract kernel bundle logic from enqueueImpKernel - for (auto Node : MSchedule) { + for (const auto &Node : MSchedule) { sycl::detail::CG::CGTYPE type = Node->MCGType; // If the node is a kernel with no special requirements we can enqueue it // directly. @@ -357,7 +357,7 @@ exec_graph_impl::~exec_graph_impl() { Event->wait(Event); } - for (auto Iter : MPiCommandBuffers) { + for (const auto &Iter : MPiCommandBuffers) { if (auto CmdBuf = Iter.second; CmdBuf) { pi_result Res = Plugin->call_nocheck< sycl::detail::PiApiKind::piextCommandBufferRelease>(CmdBuf); @@ -609,7 +609,7 @@ void executable_command_graph::finalizeImpl() { impl->schedule(); auto Context = impl->getContext(); - for (auto Device : Context.get_devices()) { + for (const auto &Device : Context.get_devices()) { bool CmdBufSupport = Device.get_info< ext::oneapi::experimental::info::device::graph_support>() == diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index e7e24ecb536f8..d4e46c9d78fed 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -2385,7 +2385,7 @@ pi_int32 enqueueImpCommandBufferKernel( pi_program PiProgram = nullptr; auto Kernel = CommandGroup.MSyclKernel; - const KernelArgMask *EliminatedArgMask; + const KernelArgMask *EliminatedArgMask = nullptr; if (Kernel != nullptr) { PiKernel = Kernel->getHandleRef(); } else { diff --git a/sycl/source/detail/scheduler/scheduler.cpp b/sycl/source/detail/scheduler/scheduler.cpp index b674c3a820a00..3205d5c407f7a 100644 --- a/sycl/source/detail/scheduler/scheduler.cpp +++ b/sycl/source/detail/scheduler/scheduler.cpp @@ -151,7 +151,7 @@ EventImplPtr Scheduler::addCG( if (ShouldEnqueue) { enqueueCommandForCG(NewEvent, AuxiliaryCmds); - for (auto StreamImplPtr : Streams) { + for (const auto &StreamImplPtr : Streams) { StreamImplPtr->flush(NewEvent); }