From ab30f23f91876c22130b60f9d609a3b3cfa647ca Mon Sep 17 00:00:00 2001 From: shawn <1021362695@qq.com> Date: Fri, 24 Jun 2022 17:54:21 +0800 Subject: [PATCH] Update native.cpp (#6650) fix issue 6640 --- deploy/android_demo/app/src/main/cpp/native.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/android_demo/app/src/main/cpp/native.cpp b/deploy/android_demo/app/src/main/cpp/native.cpp index ced93255..4961e5ec 100644 --- a/deploy/android_demo/app/src/main/cpp/native.cpp +++ b/deploy/android_demo/app/src/main/cpp/native.cpp @@ -47,7 +47,7 @@ str_to_cpu_mode(const std::string &cpu_mode) { std::string upper_key; std::transform(cpu_mode.cbegin(), cpu_mode.cend(), upper_key.begin(), ::toupper); - auto index = cpu_mode_map.find(upper_key); + auto index = cpu_mode_map.find(upper_key.c_str()); if (index == cpu_mode_map.end()) { LOGE("cpu_mode not found %s", upper_key.c_str()); return paddle::lite_api::LITE_POWER_HIGH; @@ -116,4 +116,4 @@ Java_com_baidu_paddle_lite_demo_ocr_OCRPredictorNative_release( ppredictor::OCR_PPredictor *ppredictor = (ppredictor::OCR_PPredictor *)java_pointer; delete ppredictor; -} \ No newline at end of file +} -- GitLab