Fix build error with Android NDK

Verified with android ndk r22b

Signed-off-by: xiang.zhang <xiang.zhang@verisilicon.com>
This commit is contained in:
xiang.zhang 2021-09-07 14:45:23 +08:00 committed by Sven
parent 633075f689
commit 374841cbd9
2 changed files with 4 additions and 2 deletions

View File

@ -65,4 +65,6 @@ include_directories(${OVXDRV_INCLUDE_DIRS})
add_subdirectory("src/tim/")
add_subdirectory("samples/benchmark_test")
add_subdirectory("samples/lenet")
if(NOT ANDROID_TOOLCHAIN)
add_subdirectory("samples/multi_thread_test")
endif()

View File

@ -92,7 +92,7 @@ inline std::vector<T> Quantize(const std::vector<float>& data, float scale,
for (const auto& f : data) {
q.push_back(static_cast<T>(std::max<float>(
std::numeric_limits<T>::min(),
std::min<float>(std::numeric_limits<T>::max(),
std::min<float>(static_cast<float>(std::numeric_limits<T>::max()),
std::round(zero_point + (f / scale))))));
}
return q;