From ff8be889ad799a6f3fc9c6355f648bfbcff97148 Mon Sep 17 00:00:00 2001 From: Tony Targonski Date: Tue, 21 Oct 2025 18:30:29 +0000 Subject: [PATCH] Remove unused exception parameter from some files, to work with -Wunused-exception-parameter (#165770) Summary: address compiler complains that were coming up to unblock the build Test Plan: before the change ``` aten/src/ATen/native/LinearAlgebra.cpp:3623:36: error: unused exception parameter 'e' [-Werror,-Wunused-exception-parameter] 3623 | } catch (const std::exception& e) { | ``` after: targets build with `-Wunused-exception-parameter` Differential Revision: D84876246 Pull Request resolved: https://github.com/pytorch/pytorch/pull/165770 Approved by: https://github.com/Skylion007, https://github.com/cyyever Co-authored-by: Tony Targonski --- aten/src/ATen/native/LinearAlgebra.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aten/src/ATen/native/LinearAlgebra.cpp b/aten/src/ATen/native/LinearAlgebra.cpp index 7b5ec83e169..c07c7a5ac6e 100644 --- a/aten/src/ATen/native/LinearAlgebra.cpp +++ b/aten/src/ATen/native/LinearAlgebra.cpp @@ -3620,7 +3620,7 @@ Tensor& _int_mm_out_cpu(const Tensor& self, const Tensor& mat2, Tensor& result) try { mkldnn_matmul_i8i8i32(self, mat2, result); dispatched = true; - } catch (const std::exception& e) { + } catch ([[maybe_unused]] const std::exception& e) { TORCH_WARN(func_name, " failed, switching to BLAS gemm: ", e.what()); } }