From e5a76c9808429696f26e239c19bf9fc03ddbb3a1 Mon Sep 17 00:00:00 2001 From: Yan Chunwei Date: Sun, 25 Aug 2019 23:02:08 +0800 Subject: [PATCH] leave tiny-publish out of third-party dependencies (#1853) --- .gitmodules | 12 ++++++++++++ CMakeLists.txt | 20 ++++++++++---------- README_cn.md | 1 - cmake/external/eigen.cmake | 4 ++-- cmake/external/gflags.cmake | 7 ++++--- cmake/external/gtest.cmake | 13 +++++++------ cmake/external/protobuf.cmake | 19 ++++++++++++------- cmake/lite.cmake | 2 +- lite/CMakeLists.txt | 1 - lite/api/CMakeLists.txt | 4 ++-- lite/api/light_api_impl.cc | 2 +- lite/api/paddle_api.h | 11 ++++++++--- lite/api/paddle_place.h | 13 +++++++------ lite/api/resnet18_test.cc | 2 -- lite/core/cpu_info.cc | 5 +++-- lite/core/mir/subgraph/CMakeLists.txt | 2 +- lite/fluid/CMakeLists.txt | 2 +- lite/kernels/arm/CMakeLists.txt | 4 ++-- lite/operators/CMakeLists.txt | 2 +- lite/tools/build.sh | 4 ++++ lite/tools/ci_build.sh | 3 +++ lite/tools/debug/model_debug_tool.cc | 3 ++- lite/utils/logging.h | 2 +- lite/x86/math/CMakeLists.txt | 4 ++-- third-party/gflags | 1 + third-party/googletest | 1 + third-party/protobuf-host | 1 + third-party/protobuf-mobile | 1 + 28 files changed, 90 insertions(+), 56 deletions(-) create mode 100644 .gitmodules create mode 160000 third-party/gflags create mode 160000 third-party/googletest create mode 160000 third-party/protobuf-host create mode 160000 third-party/protobuf-mobile diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..107036c702 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "third-party/gflags"] + path = third-party/gflags + url = https://github.com/gflags/gflags.git +[submodule "third-party/googletest"] + path = third-party/googletest + url = https://github.com/google/googletest.git +[submodule "third-party/protobuf-mobile"] + path = third-party/protobuf-mobile + url = https://github.com/tensor-tang/protobuf.git +[submodule "third-party/protobuf-host"] + path = third-party/protobuf-host + url = https://github.com/protocolbuffers/protobuf.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a3336caa84..d51a4675c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,7 @@ endif() # check options if (LITE_ON_TINY_PUBLISH) - if (NOT (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND NOT WITH_TESTING))#LITE_WITH_JAVA AND + if (NOT (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND NOT WITH_TESTING))#LITE_WITH_JAVA AND message(FATAL_ERROR "LITE_ON_TINY_PUBLISH=ON must be used with WITH_LITE=ON LITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON LITE_WITH_JAVA=ON WITH_TESTING=OFF") return() endif() @@ -109,16 +109,15 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) include(cross_compiling/postproject) include(cross_compiling/npu) # check and prepare NPU DDK - # include the necessary thirdparty dependencies - include(external/gflags) # download, build, install gflags - - # LITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON will disable glog - # TODO(sangoly): refine WITH_LITE and LITE_WITH_LIGHT_WEIGHT_FRAMEWORK - #include(external/glog) # download, build, install glog - include(external/gtest) # download, build, install gtest - include(ccache) # set ccache for compilation - + # We compile the mobile deployment library when LITE_ON_TINY_PUBLISH=ON + # So the following third party dependencies are not needed. if (NOT LITE_ON_TINY_PUBLISH) + # include the necessary thirdparty dependencies + include(external/gflags) # download, build, install gflags + # LITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON will disable glog + # TODO(sangoly): refine WITH_LITE and LITE_WITH_LIGHT_WEIGHT_FRAMEWORK + include(external/gtest) # download, build, install gtest + include(ccache) # set ccache for compilation include(external/protobuf) # download, build, install protobuf endif() @@ -134,6 +133,7 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) add_subdirectory(lite) return() endif() +################################# End of mobile compile ############################## set(WITH_MKLML ${WITH_MKL}) if (NOT DEFINED WITH_MKLDNN) diff --git a/README_cn.md b/README_cn.md index 42b91840ce..eb1ab42b32 100644 --- a/README_cn.md +++ b/README_cn.md @@ -51,7 +51,6 @@ Paddle Lite 借鉴了以下开源项目: - [ARM compute library]((https://github.com/ARM-software/ComputeLibrary)) - [Anakin](https://github.com/PaddlePaddle/Anakin) ,Anakin对应底层的一些优化实现已被集成到Paddle Lite。Anakin作为PaddlePaddle组织下的一个高性能预测项目,极具前瞻性,对Paddle Lite有重要贡献。Anakin已和本项目实现整合。之后,Anakin不再升级。 - ## 交流与反馈 * 欢迎您通过Github Issues来提交问题、报告与建议 * QQ群: 696965088 diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index 72441160f8..bd0d117a63 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -5,8 +5,8 @@ SET(EIGEN_INCLUDE_DIR ${EIGEN_SOURCE_DIR}/src/extern_eigen3) INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIR}) if(NOT WITH_FAST_MATH) # EIGEN_FAST_MATH: https://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html - # enables some optimizations which might affect the accuracy of the result. - # This currently enables the SSE vectorization of sin() and cos(), + # enables some optimizations which might affect the accuracy of the result. + # This currently enables the SSE vectorization of sin() and cos(), # and speedups sqrt() for single precision. # Defined to 1 by default. Define it to 0 to disable. add_definitions(-DEIGEN_FAST_MATH=0) diff --git a/cmake/external/gflags.cmake b/cmake/external/gflags.cmake index 5dc5a60f50..44ede96171 100644 --- a/cmake/external/gflags.cmake +++ b/cmake/external/gflags.cmake @@ -14,7 +14,7 @@ INCLUDE(ExternalProject) -SET(GFLAGS_SOURCES_DIR ${THIRD_PARTY_PATH}/gflags) +SET(GFLAGS_SOURCES_DIR ${CMAKE_SOURCE_DIR}/third-party/gflags) SET(GFLAGS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gflags) SET(GFLAGS_INCLUDE_DIR "${GFLAGS_INSTALL_DIR}/include" CACHE PATH "gflags include directory." FORCE) IF(WIN32) @@ -37,9 +37,10 @@ SET(OPTIONAL_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" ExternalProject_Add( extern_gflags ${EXTERNAL_PROJECT_LOG_ARGS} - GIT_REPOSITORY "https://github.com/gflags/gflags.git" + GIT_REPOSITORY "" GIT_TAG 77592648e3f3be87d6c7123eb81cbad75f9aef5a - PREFIX ${GFLAGS_SOURCES_DIR} + SOURCE_DIR ${GFLAGS_SOURCES_DIR} + PREFIX ${GFLAGS_INCLUDE_DIR} UPDATE_COMMAND "" CMAKE_ARGS -DBUILD_STATIC_LIBS=ON -DCMAKE_INSTALL_PREFIX=${GFLAGS_INSTALL_DIR} diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index b50f2729ce..0df39138dd 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -#FIXME:(gongwb) Move brpc's gtest dependency. -IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) +# the gtest is only used when WITH_TESTING=ON +IF(WITH_TESTING) IF(WITH_TESTING) ENABLE_TESTING() ENDIF(WITH_TESTING) INCLUDE(ExternalProject) - SET(GTEST_SOURCES_DIR ${THIRD_PARTY_PATH}/gtest) + SET(GTEST_SOURCES_DIR ${CMAKE_SOURCE_DIR}/third-party/googletest) SET(GTEST_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gtest) SET(GTEST_INCLUDE_DIR "${GTEST_INSTALL_DIR}/include" CACHE PATH "gtest include directory." FORCE) @@ -56,9 +56,10 @@ IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) extern_gtest ${EXTERNAL_PROJECT_LOG_ARGS} DEPENDS ${GTEST_DEPENDS} - GIT_REPOSITORY "https://github.com/google/googletest.git" + GIT_REPOSITORY "" + SOURCE_DIR ${GTEST_SOURCES_DIR} GIT_TAG "release-1.8.0" - PREFIX ${GTEST_SOURCES_DIR} + PREFIX ${GTEST_INSTALL_DIR} UPDATE_COMMAND "" CMAKE_ARGS ${CROSS_COMPILE_CMAKE_ARGS} ${OPTIONAL_ARGS} @@ -82,4 +83,4 @@ IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) SET_PROPERTY(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${GTEST_MAIN_LIBRARIES}) ADD_DEPENDENCIES(gtest_main extern_gtest) -ENDIF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) +ENDIF() diff --git a/cmake/external/protobuf.cmake b/cmake/external/protobuf.cmake index a302987794..84be88226f 100644 --- a/cmake/external/protobuf.cmake +++ b/cmake/external/protobuf.cmake @@ -177,10 +177,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST) "${PROTOBUF_INSTALL_DIR}/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}" PARENT_SCOPE) - SET(PROTOBUF_REPO "https://github.com/protocolbuffers/protobuf.git") + # https://github.com/protocolbuffers/protobuf.git + SET(PROTOBUF_REPO "") SET(PROTOBUF_TAG "9f75c5aa851cd877fb0d93ccc31b8567a6706546") SET(OPTIONAL_CACHE_ARGS "") SET(OPTIONAL_ARGS "") + SET(SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/protobuf-host") IF(BUILD_FOR_HOST) SET(OPTIONAL_ARGS @@ -191,8 +193,10 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST) SET(OPTIONAL_CACHE_ARGS "-DZLIB_ROOT:STRING=${ZLIB_ROOT}") ELSE() # protobuf have compile issue when use android stl c++_static - SET(PROTOBUF_REPO "https://github.com/tensor-tang/protobuf.git") + # https://github.com/tensor-tang/protobuf.git + SET(PROTOBUF_REPO "") SET(PROTOBUF_TAG "mobile") + SET(SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/protobuf-mobile") SET(OPTIONAL_ARGS "-Dprotobuf_WITH_ZLIB=OFF" ${CROSS_COMPILE_CMAKE_ARGS} "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" @@ -215,8 +219,9 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST) PREFIX ${PROTOBUF_SOURCES_DIR} SOURCE_SUBDIR cmake UPDATE_COMMAND "" - GIT_REPOSITORY ${PROTOBUF_REPO} + GIT_REPOSITORY "" GIT_TAG ${PROTOBUF_TAG} + SOURCE_DIR ${SOURCE_DIR} CMAKE_ARGS ${OPTIONAL_ARGS} -Dprotobuf_BUILD_TESTS=OFF @@ -237,12 +242,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST) ExternalProject_Add( ${TARGET_NAME} ${EXTERNAL_PROJECT_LOG_ARGS} - PREFIX ${PROTOBUF_SOURCES_DIR} + PREFIX ${SOURCE_DIR} UPDATE_COMMAND "" - GIT_REPOSITORY ${PROTOBUF_REPO} + GIT_REPOSITORY "" GIT_TAG ${PROTOBUF_TAG} - CONFIGURE_COMMAND - ${CMAKE_COMMAND} ${PROTOBUF_SOURCES_DIR}/src/${TARGET_NAME}/cmake + SOURCE_DIR ${SOURCE_DIR} + CONFIGURE_COMMAND ${CMAKE_COMMAND} ${SOURCE_DIR}/cmake ${OPTIONAL_ARGS} -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_SKIP_RPATH=ON diff --git a/cmake/lite.cmake b/cmake/lite.cmake index 89918b7cb9..2c839d36e2 100644 --- a/cmake/lite.cmake +++ b/cmake/lite.cmake @@ -368,7 +368,7 @@ function(bundle_static_library tgt_name bundled_tgt_name fake_target) set(bundled_tgt_full_name ${CMAKE_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${bundled_tgt_name}${CMAKE_STATIC_LIBRARY_SUFFIX}) - message(STATUS "+++++ bundled_tgt_full_name: ${bundled_tgt_full_name}") + #message(STATUS "bundled_tgt_full_name: ${bundled_tgt_full_name}") if(NOT IOS) file(WRITE ${CMAKE_BINARY_DIR}/${bundled_tgt_name}.ar.in diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index 8c47390480..1e1ef1ec8a 100644 --- a/lite/CMakeLists.txt +++ b/lite/CMakeLists.txt @@ -10,7 +10,6 @@ message(STATUS "LITE_WITH_FPGA:\t${LITE_WITH_FPGA}") message(STATUS "LITE_WITH_PROFILE:\t${LITE_WITH_PROFILE}") set(LITE_MODEL_DIR "${THIRD_PARTY_PATH}/install") - set(LITE_ON_MOBILE ${LITE_WITH_LIGHT_WEIGHT_FRAMEWORK}) add_subdirectory(utils) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index 85097a3e42..43c42a3749 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -128,7 +128,7 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND WITH_TESTING) set_target_properties(test_mobilenetv2 PROPERTIES LINK_FLAGS "${LINK_FLAGS}") lite_cc_test(test_resnet50 SRCS resnet50_test.cc - DEPS ${lite_model_test_DEPS} + DEPS ${lite_model_test_DEPS} paddle_api_light CL_DEPS ${opencl_kernels} FPGA_DEPS ${fpga_kernels} ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/opencl @@ -145,7 +145,7 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND WITH_TESTING) CL_DEPS ${opencl_kernels} ARGS --cl_path=${CMAKE_SOURCE_DIR}/lite/opencl --model_dir=${LITE_MODEL_DIR}/inception_v4 SERIAL) - add_dependencies(test_inceptionv4 extern_lite_download_inception_v4_simple_tar_gz) + add_dependencies(test_inceptionv4 extern_lite_download_inception_v4_simple_tar_gz) # lite_cc_test(test_ocr_attention SRCS ocr_attention_test.cc # DEPS ${lite_model_test_DEPS}) diff --git a/lite/api/light_api_impl.cc b/lite/api/light_api_impl.cc index 545c7f4829..fd42ade4c7 100644 --- a/lite/api/light_api_impl.cc +++ b/lite/api/light_api_impl.cc @@ -39,7 +39,7 @@ class LightPredictorImpl : public PaddlePredictor { }; void LightPredictorImpl::Init(const MobileConfig& config) { - // LightPredictor Only support NaiveBuffer backend in publish lib +// LightPredictor Only support NaiveBuffer backend in publish lib #ifdef LITE_WITH_ARM lite::DeviceInfo::Init(); lite::DeviceInfo::Global().SetRunMode(config.power_mode(), config.threads()); diff --git a/lite/api/paddle_api.h b/lite/api/paddle_api.h index b728b7c482..28e4e757f3 100644 --- a/lite/api/paddle_api.h +++ b/lite/api/paddle_api.h @@ -113,9 +113,14 @@ class LITE_API CxxConfig : public ConfigBase { class LITE_API MobileConfig : public ConfigBase { PowerMode mode_{LITE_POWER_HIGH}; int threads_{1}; -public: - MobileConfig(Place preferred_place=Place(TARGET(kARM), PRECISION(kFloat), DATALAYOUT(kNCHW)), - PowerMode mode=LITE_POWER_HIGH, int threads=1) : mode_(mode), threads_(threads) {} + + public: + MobileConfig(Place preferred_place = Place(TARGET(kARM), + PRECISION(kFloat), + DATALAYOUT(kNCHW)), + PowerMode mode = LITE_POWER_HIGH, + int threads = 1) + : mode_(mode), threads_(threads) {} void set_power_mode(PowerMode mode) { mode_ = mode; } void set_threads(int threads) { threads_ = threads; } diff --git a/lite/api/paddle_place.h b/lite/api/paddle_place.h index f7fc29e7d6..0e5d36aba4 100644 --- a/lite/api/paddle_place.h +++ b/lite/api/paddle_place.h @@ -70,13 +70,14 @@ enum class DataLayoutType : int { kAny = 2, // any data layout NUM = 4, // number of fields. }; + typedef enum { - LITE_POWER_HIGH = 0, - LITE_POWER_LOW = 1, - LITE_POWER_FULL = 2, - LITE_POWER_NO_BIND = 3, - LITE_POWER_RAND_HIGH = 4, - LITE_POWER_RAND_LOW = 5 + LITE_POWER_HIGH = 0, + LITE_POWER_LOW = 1, + LITE_POWER_FULL = 2, + LITE_POWER_NO_BIND = 3, + LITE_POWER_RAND_HIGH = 4, + LITE_POWER_RAND_LOW = 5 } PowerMode; enum class ActivationType : int { diff --git a/lite/api/resnet18_test.cc b/lite/api/resnet18_test.cc index 5176ad8e4c..8de36f8d62 100644 --- a/lite/api/resnet18_test.cc +++ b/lite/api/resnet18_test.cc @@ -27,8 +27,6 @@ namespace lite { #ifdef LITE_WITH_ARM TEST(ResNet18, test) { - DeviceInfo::Init(); - DeviceInfo::Global().SetRunMode(lite_api::LITE_POWER_HIGH, FLAGS_threads); lite::Predictor predictor; std::vector valid_places({Place{TARGET(kHost), PRECISION(kFloat)}, Place{TARGET(kARM), PRECISION(kFloat)}}); diff --git a/lite/core/cpu_info.cc b/lite/core/cpu_info.cc index e882ef59bd..4244d77357 100644 --- a/lite/core/cpu_info.cc +++ b/lite/core/cpu_info.cc @@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) { int little_core_size = little_core_ids_.size(); active_ids_.clear(); if (big_core_size > 0) { - mode_ =lite_api::PowerMode::LITE_POWER_HIGH; + mode_ = lite_api::PowerMode::LITE_POWER_HIGH; if (thread_num > big_core_size) { LOG(ERROR) << "Request thread num: " << thread_num << ", exceed the big cores size: " << big_core_size @@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() { } LOG(INFO) << "Total memory: " << mem_size_ << "KB"; // set default run mode - SetRunMode(lite_api::PowerMode::LITE_POWER_NO_BIND, 1); // use single thread by default + SetRunMode(lite_api::PowerMode::LITE_POWER_NO_BIND, + 1); // use single thread by default return 0; } diff --git a/lite/core/mir/subgraph/CMakeLists.txt b/lite/core/mir/subgraph/CMakeLists.txt index fa2af906b2..9984e202db 100644 --- a/lite/core/mir/subgraph/CMakeLists.txt +++ b/lite/core/mir/subgraph/CMakeLists.txt @@ -31,4 +31,4 @@ if(LITE_WITH_NPU) endif() set(subgraph_passes ${subgraph_passes} CACHE INTERNAL "subgraph_passes") -message(STATUS "+++++ subgraph_passes: ${subgraph_passes}") +message(STATUS "----> subgraph_passes: ${subgraph_passes}") diff --git a/lite/fluid/CMakeLists.txt b/lite/fluid/CMakeLists.txt index 2258ae61cd..308dcb2c30 100644 --- a/lite/fluid/CMakeLists.txt +++ b/lite/fluid/CMakeLists.txt @@ -1,4 +1,4 @@ if (LITE_WITH_X86) -lite_cc_library(fluid_data_type SRCS data_type.cc DEPS framework_proto) +lite_cc_library(fluid_data_type SRCS data_type.cc DEPS framework_proto eigen3) # lite_cc_library(selected_rows SRCS selected_rows.cc) endif() diff --git a/lite/kernels/arm/CMakeLists.txt b/lite/kernels/arm/CMakeLists.txt index 524a235ef4..39244971c2 100644 --- a/lite/kernels/arm/CMakeLists.txt +++ b/lite/kernels/arm/CMakeLists.txt @@ -43,10 +43,10 @@ add_kernel(squeeze_compute_arm ARM basic SRCS squeeze_compute.cc DEPS ${lite_ker add_kernel(expand_compute_arm ARM basic SRCS expand_compute.cc DEPS ${lite_kernel_deps} math_arm) add_kernel(reduce_max_compute_arm ARM basic SRCS reduce_max_compute.cc DEPS ${lite_kernel_deps} math_arm) add_kernel(sequence_expand_compute_arm ARM basic SRCS sequence_expand_compute.cc DEPS ${lite_kernel_deps} math_arm) +add_kernel(im2sequence_compute_arm ARM basic SRCS im2sequence_compute.cc DEPS ${lite_kernel_deps} math_arm) +add_kernel(sequence_pool_compute_arm ARM basic SRCS sequence_pool_compute.cc DEPS ${lite_kernel_deps} math_arm) # for OCR specific -add_kernel(im2sequence_compute_arm ARM extra SRCS im2sequence_compute.cc DEPS ${lite_kernel_deps} math_arm) -add_kernel(sequence_pool_compute_arm ARM extra SRCS sequence_pool_compute.cc DEPS ${lite_kernel_deps} math_arm) add_kernel(gru_unit_compute_arm ARM extra SRCS gru_unit_compute.cc DEPS ${lite_kernel_deps} math_arm) add_kernel(gru_compute_arm ARM extra SRCS gru_compute.cc DEPS ${lite_kernel_deps} math_arm) add_kernel(beam_search_decode_compute_arm ARM extra SRCS beam_search_decode_compute.cc DEPS ${lite_kernel_deps} math_arm) diff --git a/lite/operators/CMakeLists.txt b/lite/operators/CMakeLists.txt index f46c0f02d6..1893844314 100644 --- a/lite/operators/CMakeLists.txt +++ b/lite/operators/CMakeLists.txt @@ -58,9 +58,9 @@ add_operator(norm_op basic SRCS norm_op.cc DEPS ${op_DEPS}) add_operator(shape_op_lite basic SRCS shape_op.cc DEPS ${op_DEPS}) add_operator(sequence_expand_op_lite basic SRCS sequence_expand_op.cc DEPS ${op_DEPS}) add_operator(squeeze_op_lite basic SRCS squeeze_op.cc DEPS ${op_DEPS}) +add_operator(im2sequence_op basic SRCS im2sequence_op.cc DEPS ${op_DEPS}) # for OCR specific -add_operator(im2sequence_op extra SRCS im2sequence_op.cc DEPS ${op_DEPS}) add_operator(while_op extra SRCS while_op.cc DEPS ${op_DEPS}) add_operator(lookup_table_op extra SRCS lookup_table_op.cc DEPS ${op_DEPS}) add_operator(beam_search_decode_op extra SRCS beam_search_decode_op.cc DEPS ${op_DEPS}) diff --git a/lite/tools/build.sh b/lite/tools/build.sh index 7041e5b8f4..6e1cb7aba9 100755 --- a/lite/tools/build.sh +++ b/lite/tools/build.sh @@ -58,6 +58,8 @@ function make_full_publish_so { local lang=$3 local android_stl=$4 + git submodule update --init --recursive + cur_dir=$(pwd) build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} if [ -d $build_dir ] @@ -85,6 +87,7 @@ function make_all_tests { local abi=$2 local lang=$3 + git submodule update --init --recursive cur_dir=$(pwd) build_dir=$cur_dir/build.lite.${os}.${abi}.${lang} if [ -d $build_dir ] @@ -106,6 +109,7 @@ function make_all_tests { function print_usage { + set +x echo -e "\nUSAGE:" echo echo "----------------------------------------" diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 54ca3427a0..e3b4d176cf 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -22,6 +22,9 @@ function prepare_workspace { DEBUG_TOOL_PATH_PREFIX=lite/tools/debug mkdir -p ./${DEBUG_TOOL_PATH_PREFIX} cp ../${DEBUG_TOOL_PATH_PREFIX}/analysis_tool.py ./${DEBUG_TOOL_PATH_PREFIX}/ + + # clone submodule + git submodule update --init --recursive } function check_need_ci { diff --git a/lite/tools/debug/model_debug_tool.cc b/lite/tools/debug/model_debug_tool.cc index 38afc96914..ac6c3290ff 100644 --- a/lite/tools/debug/model_debug_tool.cc +++ b/lite/tools/debug/model_debug_tool.cc @@ -33,7 +33,8 @@ void Run(DebugConfig* conf) { CHECK(conf); #ifdef LITE_WITH_ARM DeviceInfo::Init(); - DeviceInfo::Global().SetRunMode(lite_api::LITE_POWER_HIGH, conf->arm_thread_num); + DeviceInfo::Global().SetRunMode(lite_api::LITE_POWER_HIGH, + conf->arm_thread_num); #endif lite::Predictor predictor; std::vector valid_places({ diff --git a/lite/utils/logging.h b/lite/utils/logging.h index c593bcf76b..8dbb7a9752 100644 --- a/lite/utils/logging.h +++ b/lite/utils/logging.h @@ -18,13 +18,13 @@ */ #pragma once +#include #include #include #include #include #include #include -#include #include "lite/utils/replace_stl/stream.h" // NOLINTFILE() diff --git a/lite/x86/math/CMakeLists.txt b/lite/x86/math/CMakeLists.txt index 482e8f9c7c..24b3df5a87 100644 --- a/lite/x86/math/CMakeLists.txt +++ b/lite/x86/math/CMakeLists.txt @@ -16,7 +16,7 @@ function(math_library TARGET) endif() list(LENGTH cc_srcs cc_srcs_len) - lite_cc_library(${TARGET} SRCS ${cc_srcs} DEPS ${math_library_DEPS} ${math_common_deps}) + lite_cc_library(${TARGET} SRCS ${cc_srcs} DEPS ${math_library_DEPS} ${math_common_deps} eigen3) endfunction() # please add new math_library in alphabetical order @@ -32,7 +32,7 @@ math_library(sampler) math_library(gru_compute DEPS activation_functions math_function) ## math_library(lstm_compute DEPS activation_functions) -lite_cc_library(blas SRCS blas.cc DEPS cblas framework_proto) +lite_cc_library(blas SRCS blas.cc DEPS cblas framework_proto eigen3) math_library(math_function DEPS blas) math_library(maxouting) math_library(pooling) diff --git a/third-party/gflags b/third-party/gflags new file mode 160000 index 0000000000..77592648e3 --- /dev/null +++ b/third-party/gflags @@ -0,0 +1 @@ +Subproject commit 77592648e3f3be87d6c7123eb81cbad75f9aef5a diff --git a/third-party/googletest b/third-party/googletest new file mode 160000 index 0000000000..ec44c6c167 --- /dev/null +++ b/third-party/googletest @@ -0,0 +1 @@ +Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780 diff --git a/third-party/protobuf-host b/third-party/protobuf-host new file mode 160000 index 0000000000..9f75c5aa85 --- /dev/null +++ b/third-party/protobuf-host @@ -0,0 +1 @@ +Subproject commit 9f75c5aa851cd877fb0d93ccc31b8567a6706546 diff --git a/third-party/protobuf-mobile b/third-party/protobuf-mobile new file mode 160000 index 0000000000..0bccaabfc6 --- /dev/null +++ b/third-party/protobuf-mobile @@ -0,0 +1 @@ +Subproject commit 0bccaabfc6fda5b04d7460110ae075b7eebe9d2a -- GitLab