From 94244715c4f4cccc678b19347755ed154b6284d3 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Thu, 29 Aug 2019 21:53:51 +0800 Subject: [PATCH] [NPU] fix npu compile of publish_inference (#1911) --- lite/CMakeLists.txt | 3 +++ lite/model_parser/CMakeLists.txt | 3 ++- lite/tools/build_npu.sh | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index 1e1ef1ec8a..39985d5b9c 100644 --- a/lite/CMakeLists.txt +++ b/lite/CMakeLists.txt @@ -59,6 +59,9 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) if (LITE_WITH_OPENCL) set(INFER_LITE_PUBLISH_ROOT "${INFER_LITE_PUBLISH_ROOT}.opencl") endif(LITE_WITH_OPENCL) + if (LITE_WITH_NPU) + set(INFER_LITE_PUBLISH_ROOT "${INFER_LITE_PUBLISH_ROOT}.npu") + endif(LITE_WITH_NPU) message(STATUS "publish inference lib to ${INFER_LITE_PUBLISH_ROOT}") # The final target for publish lite lib diff --git a/lite/model_parser/CMakeLists.txt b/lite/model_parser/CMakeLists.txt index d9871ff177..2df9b97e55 100644 --- a/lite/model_parser/CMakeLists.txt +++ b/lite/model_parser/CMakeLists.txt @@ -28,6 +28,7 @@ lite_cc_library(model_parser SRCS model_parser.cc DEPS target_wrapper_host compatible_pb memory - CUDA_DEPS target_wrapper_cuda) + CUDA_DEPS target_wrapper_cuda + NPU_DEPS npu_helper) lite_cc_test(test_compatible_pb SRCS compatible_pb_test.cc DEPS compatible_pb) diff --git a/lite/tools/build_npu.sh b/lite/tools/build_npu.sh index eb96508283..24bbd868a4 100755 --- a/lite/tools/build_npu.sh +++ b/lite/tools/build_npu.sh @@ -107,7 +107,14 @@ function build_npu { test_name=$6 fi - build_dir=$cur_dir/build.lite.npu.${os}.${abi}.${lang}.${stl} + # the c++ symbol is not recognized by the bundled script + if [[ "${stl}" == "c++_shared" ]]; then + stl_dir="cxx_shared" + fi + if [[ "${stl}" == "c++_static" ]]; then + stl_dir="cxx_static" + fi + build_dir=$cur_dir/build.lite.npu.${os}.${abi}.${lang}.${stl_dir} mkdir -p $build_dir cd $build_dir -- GitLab