From 121223eef39b49145c837a9ce844543986225ec7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 17 Oct 2024 12:53:05 -0700 Subject: [PATCH] executorch/backends/cadence/reference/operators/quantized_layer_norm.cpp: fix a few format mismatches via static_cast() (#6322) Summary: Avoids a few errors like the following: executorch/backends/cadence/reference/operators/quantize_per_tensor.cpp:47:55: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] Reviewed By: tarun292, zonglinpeng, mcremon-meta Differential Revision: D64519629 --- .../cadence/reference/operators/dequantize_per_tensor.cpp | 5 ++++- backends/cadence/reference/operators/quantize_per_tensor.cpp | 5 ++++- .../cadence/reference/operators/quantized_layer_norm.cpp | 5 ++++- backends/cadence/reference/operators/quantized_relu_out.cpp | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/backends/cadence/reference/operators/dequantize_per_tensor.cpp b/backends/cadence/reference/operators/dequantize_per_tensor.cpp index bbf427e069d..aef730bfd1b 100644 --- a/backends/cadence/reference/operators/dequantize_per_tensor.cpp +++ b/backends/cadence/reference/operators/dequantize_per_tensor.cpp @@ -42,7 +42,10 @@ void dequantize_per_tensor_out( impl::reference::kernels::dequantize( out_data, input_data, scale, zero_point, numel); } else { - ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type()); + ET_CHECK_MSG( + false, + "Unhandled input dtype %hhd", + static_cast(input.scalar_type())); } } diff --git a/backends/cadence/reference/operators/quantize_per_tensor.cpp b/backends/cadence/reference/operators/quantize_per_tensor.cpp index df44171cf1b..0d7ff0bc7ea 100644 --- a/backends/cadence/reference/operators/quantize_per_tensor.cpp +++ b/backends/cadence/reference/operators/quantize_per_tensor.cpp @@ -44,7 +44,10 @@ void quantize_per_tensor_out( impl::reference::kernels::quantize( out_data, input_data, 1. / scale, zero_point, numel); } else { - ET_CHECK_MSG(false, "Unhandled input dtype %hhd", out.scalar_type()); + ET_CHECK_MSG( + false, + "Unhandled input dtype %hhd", + static_cast(out.scalar_type())); } } diff --git a/backends/cadence/reference/operators/quantized_layer_norm.cpp b/backends/cadence/reference/operators/quantized_layer_norm.cpp index 27b5bb76617..92b1edf3dde 100644 --- a/backends/cadence/reference/operators/quantized_layer_norm.cpp +++ b/backends/cadence/reference/operators/quantized_layer_norm.cpp @@ -145,7 +145,10 @@ void quantized_layer_norm_out( output_zero_point, out); } else { - ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type()); + ET_CHECK_MSG( + false, + "Unhandled input dtype %hhd", + static_cast(input.scalar_type())); } } diff --git a/backends/cadence/reference/operators/quantized_relu_out.cpp b/backends/cadence/reference/operators/quantized_relu_out.cpp index 460084fcfb0..19b971405c9 100644 --- a/backends/cadence/reference/operators/quantized_relu_out.cpp +++ b/backends/cadence/reference/operators/quantized_relu_out.cpp @@ -68,7 +68,10 @@ void quantized_relu_out( out_shift, output); } else { - ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type()); + ET_CHECK_MSG( + false, + "Unhandled input dtype %hhd", + static_cast(input.scalar_type())); } }