diff --git a/examples/arm/zephyr/prj.conf b/examples/arm/zephyr/prj.conf index 59b857c708a..8ec0aefa4d1 100644 --- a/examples/arm/zephyr/prj.conf +++ b/examples/arm/zephyr/prj.conf @@ -11,10 +11,6 @@ CONFIG_EXECUTORCH=y CONFIG_CPP=y CONFIG_STD_CPP17=y -# Needed as kernels/portable/cpu/op_allclose.cpp uses isfinite() instead of std::isfinite() -# If you fully delegated your model to Ethos-U you could remove this and save some space -CONFIG_NEWLIB_LIBC=y - # Config - increased for ExecuTorch memory requirements CONFIG_MAIN_STACK_SIZE=8192 CONFIG_HEAP_MEM_POOL_SIZE=32768 diff --git a/kernels/portable/cpu/op_allclose.cpp b/kernels/portable/cpu/op_allclose.cpp index 51fd9ebb65b..a1b2cb87389 100644 --- a/kernels/portable/cpu/op_allclose.cpp +++ b/kernels/portable/cpu/op_allclose.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. + * Copyright 2025 Arm Limited and/or its affiliates. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. @@ -8,8 +9,8 @@ #include #include -#include #include +#include namespace torch { namespace executor { @@ -42,7 +43,7 @@ bool data_is_close( } else { auto allowed_error = atol + fabs(rtol * b[i]); auto actual_error = fabs(a[i] - b[i]); - if (!isfinite(actual_error) || actual_error > allowed_error) { + if (!std::isfinite(actual_error) || actual_error > allowed_error) { return false; } }