diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d24079e46d23fe174e8eddf85976987f6e3b75a..c3bc52bda43c5c39efff56b0747c3fe0718db215 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -668,7 +668,8 @@ if(NOT MGE_ENABLE_EXCEPTIONS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") endif() -if(MGE_BUILD_IMPERATIVE_RT) +if(MGE_BUILD_IMPERATIVE_RT OR ANDROID) + message(STATUS "config cxx standard to 17.") set(CMAKE_CXX_STANDARD 17) endif() diff --git a/lite/load_and_run/src/strategys/strategy_normal.cpp b/lite/load_and_run/src/strategys/strategy_normal.cpp index c0e842ab4c1015343cc00ad9098905aa1e0142e2..168040b9e92a6d7a31fcc14891d22313c8ffea09 100644 --- a/lite/load_and_run/src/strategys/strategy_normal.cpp +++ b/lite/load_and_run/src/strategys/strategy_normal.cpp @@ -93,13 +93,15 @@ void NormalStrategy::run_subline() { min_time = std::min(min_time, cur); max_time = std::max(max_time, cur); } - mgb_log("=== finished test #%u: time=%.3f ms avg_time=%.3f ms " - "standard_deviation=%.3f ms min=%.3f ms max=%.3f ms", - idx, time_sum, time_sum / run_num, - std::sqrt( - (time_sqrsum * run_num - time_sum * time_sum) / - (run_num * (run_num - 1))), - min_time, max_time); + if (run_num > 0) { + mgb_log("=== finished test #%u: time=%.3f ms avg_time=%.3f ms " + "standard_deviation=%.3f ms min=%.3f ms max=%.3f ms", + idx, time_sum, time_sum / run_num, + std::sqrt( + (time_sqrsum * run_num - time_sum * time_sum) / + (run_num * (run_num - 1))), + min_time, max_time); + } return time_sum; };