From b973cc43d3677b2a4928cb758a398e45ea1f3fb1 Mon Sep 17 00:00:00 2001 From: yinglu Date: Fri, 20 Mar 2026 16:22:14 +0800 Subject: [PATCH] [CK]fix: remove redundant structured sparsity check in run_gemm_example.inc (#5612) ## Motivation This issue if found via https://github.com/ROCm/rocm-libraries/pull/4302#discussion_r2958603418 and is introduced via https://github.com/ROCm/rocm-libraries/pull/5323. ## Technical Details The outer `if` and inner `if constexpr` both checked GemmConfig::UseStructuredSparsity. Merged into a single `if constexpr` since both preshuffle and UseStructuredSparsity are compile-time constants. ## Test Plan ## Test Result ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --- example/ck_tile/03_gemm/run_gemm_example.inc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/example/ck_tile/03_gemm/run_gemm_example.inc b/example/ck_tile/03_gemm/run_gemm_example.inc index 39dd6357e5..4d13bca2a0 100644 --- a/example/ck_tile/03_gemm/run_gemm_example.inc +++ b/example/ck_tile/03_gemm/run_gemm_example.inc @@ -284,12 +284,9 @@ int run_gemm_example_with_layouts(ck_tile::ArgParser& arg_parser, b_k_n.SetZero(); } - if(!preshuffle && GemmConfig::UseStructuredSparsity) + if constexpr(!preshuffle && GemmConfig::UseStructuredSparsity) { - if constexpr(GemmConfig::UseStructuredSparsity) - { - ck_tile::AdjustToStructuredSparsity{}(a_m_k); - } + ck_tile::AdjustToStructuredSparsity{}(a_m_k); } ck_tile::DeviceMem a_m_k_dev_buf(a_m_k.get_element_space_size_in_bytes());