From f71dac4b62c0f4ff71094ba848c83a4e61748f8b Mon Sep 17 00:00:00 2001 From: Hyeongseok Oh Date: Fri, 3 Jan 2025 10:21:34 +0900 Subject: [PATCH] [onert/test] Apply strict build to tflite_comparator This commit applies strict build to tflite_comparator. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh --- tests/tools/tflite_comparator/CMakeLists.txt | 1 + tests/tools/tflite_comparator/src/tflite_comparator.cc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tools/tflite_comparator/CMakeLists.txt b/tests/tools/tflite_comparator/CMakeLists.txt index fe6dbe5402a..582a471b75c 100644 --- a/tests/tools/tflite_comparator/CMakeLists.txt +++ b/tests/tools/tflite_comparator/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND SOURCES "src/args.cc") add_executable(tflite_comparator ${SOURCES}) +target_link_libraries(tflite_comparator nnfw_common) target_link_libraries(tflite_comparator nnfw-dev) target_link_libraries(tflite_comparator nnfw_lib_tflite nnfw_lib_misc) target_link_libraries(tflite_comparator arser) diff --git a/tests/tools/tflite_comparator/src/tflite_comparator.cc b/tests/tools/tflite_comparator/src/tflite_comparator.cc index d581e7cfd88..6eae20aa10e 100644 --- a/tests/tools/tflite_comparator/src/tflite_comparator.cc +++ b/tests/tools/tflite_comparator/src/tflite_comparator.cc @@ -89,7 +89,7 @@ void randomBoolData(benchmark::RandomGenerator &randgen, std::vector &d inline uint64_t num_elems(const nnfw_tensorinfo *ti) { uint64_t n = 1; - for (uint32_t i = 0; i < ti->rank; ++i) + for (int32_t i = 0; i < ti->rank; ++i) { n *= ti->dims[i]; } @@ -172,7 +172,7 @@ template <> bool isClose(const uint8_t *ref_buf, const std::vector &act_buf, uint32_t index) { // TODO better way for handling quant error? - auto tolerance = static_cast(nnfw::misc::EnvVar("TOLERANCE").asInt(0)); + auto tolerance = nnfw::misc::EnvVar("TOLERANCE").asInt(0); bool match = true; for (uint32_t e = 0; e < act_buf.size() / sizeof(uint8_t); e++) @@ -294,6 +294,7 @@ int main(const int argc, char **argv) break; case NNFW_TYPE_TENSOR_QUANT16_SYMM_SIGNED: randomData(randgen, inputs[i]); + break; case NNFW_TYPE_TENSOR_FLOAT32: randomData(randgen, inputs[i]); break;