From f27d18fbf7148e3f3b2fb6f78f866b46be43ecc0 Mon Sep 17 00:00:00 2001 From: Hardik Sharma Date: Wed, 26 Nov 2025 13:10:11 -0800 Subject: [PATCH] Fix -Wimplicit-const-int-float-conversion error. (#15982) Summary: as titled Reviewed By: skrtskrtfb, zonglinpeng Differential Revision: D87882617 --- backends/cadence/vision/kernels/kernels.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/cadence/vision/kernels/kernels.cpp b/backends/cadence/vision/kernels/kernels.cpp index 70c811df741..d87ff98e06f 100644 --- a/backends/cadence/vision/kernels/kernels.cpp +++ b/backends/cadence/vision/kernels/kernels.cpp @@ -25,8 +25,8 @@ void* allocate_temp_memory(KernelRuntimeContext& ctx, size_t size) { // Quantize a fp32 value to an int8_t/uint8_t value template T quantize(const float x, float scale, int32_t zero_point) { - constexpr float min_val = std::numeric_limits::min(); - constexpr float max_val = std::numeric_limits::max(); + constexpr float min_val = static_cast(std::numeric_limits::min()); + constexpr float max_val = static_cast(std::numeric_limits::max()); float tmp = roundf(x * scale + zero_point); return std::max(std::min(tmp, max_val), min_val); }