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); }