From dff46752a7abdaccd6ce9ef4a9d8e7d078ceddce Mon Sep 17 00:00:00 2001 From: Nigel Huang Date: Wed, 5 Mar 2025 20:03:22 -0800 Subject: [PATCH] Initialize variables (#18682) ### Ticket N/A ### Problem description Need to initialize variables to ensure consistent behaviour ### What's changed Set them to false as the kernels haven't been found yet from dynamic_cast ### Checklist - [ ] [All post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/all-post-commit-workflows.yaml) CI passes - [ ] [Blackhole Post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml) CI passes (if applicable) - [ ] [Model regression](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-models.yaml) CI passes (if applicable) - [ ] [Device performance regression](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-device-models.yaml) CI passes (if applicable) - [ ] **(For models and ops writers)** Full [new models tests](https://github.com/tenstorrent/tt-metal/actions/workflows/full-new-models-suite.yaml) CI passes (if applicable) - [ ] New/Existing tests provide coverage for changes --- tt_metal/impl/dispatch/kernel_config/dispatch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tt_metal/impl/dispatch/kernel_config/dispatch.cpp b/tt_metal/impl/dispatch/kernel_config/dispatch.cpp index e0eaf1cc2c1..d40f8f0fb1a 100644 --- a/tt_metal/impl/dispatch/kernel_config/dispatch.cpp +++ b/tt_metal/impl/dispatch/kernel_config/dispatch.cpp @@ -271,9 +271,9 @@ void DispatchKernel::GenerateDependentConfigs() { auto dispatch_s_kernel = dynamic_cast(downstream_kernels_[0]); auto mux_kernel = dynamic_cast(downstream_kernels_[0]); - bool found_dispatch_s; - bool found_mux; - bool found_dispatch_h; + bool found_dispatch_s = false; + bool found_mux = false; + bool found_dispatch_h = false; for (auto ds_kernel : downstream_kernels_) { if (auto dispatch_s_kernel = dynamic_cast(ds_kernel)) { dependent_config_.downstream_s_logical_core = dispatch_s_kernel->GetLogicalCore();