diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..107036c70292cf33e945f45a8bac935dea554ece --- /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 a3336caa8463ceca536a81f53665a6809426514c..d51a4675c34e35b0d0bf89ffc2389f75a694123f 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 42b91840ce37993e7a1de08208839daa6993a65a..eb1ab42b323eb20510c82cad80c40da03231de88 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 72441160f89d2c188d35fc6b08b5f0b6d746a1ad..bd0d117a633824d93c403b8167ff49505160069b 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 5dc5a60f509f9fc5341b1add97c3db9a4156b2f7..44ede9617159fde51939f0ad71fc98e95325865f 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 b50f2729ce3ae7eaaa2c2ce175799b2ad4648169..0df39138dd33de701fce80945d457b55a372ae17 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 a302987794598d1a8dd0da8f4513b06b4751206c..84be88226f4144c30840fe5a37d35d54b357630c 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 89918b7cb94997d1a38cad81532e81f90756474f..2c839d36e27429672b1098bae4d5cbed16731115 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 8c473904808454aa75dbd2fabfe5cc0bee75eff0..1e1ef1ec8aa79bbb1bf1aa8a3cc96413ad80c08a 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 85097a3e42c18ca3d154ef34783b68c90ced975b..43c42a3749aa125a7f72bba4699fb0de811519f1 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 545c7f4829eaa457813ee9db12f1d4f75507feab..fd42ade4c7579b9c204fb41926636182727ec4dc 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 b728b7c482e8bae0290c6a189f71876bac957215..28e4e757f34b5d1319829f57c5cbb230253e3471 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 f7fc29e7d6c5a902ab7d7a4f18e314885aaf2ac0..0e5d36aba43469882bf4dcc9aacc518acb3af597 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 5176ad8e4cb95f1173952a6593e41b1fb8450431..8de36f8d62c6907b31fb6babbb6b4bc9b38e352a 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 e882ef59bdbd0a3ab55d01626ad9480cbf74a8a7..4244d773571623babaef23e5e317fc5bbe5363cd 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 fa2af906b2f7fd87e4991a915fbbeb348dac522c..9984e202db08d95bbcd691888d91f06a7a3b1d2f 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 2258ae61cda858f236eddd733b39cf884c0b81ba..308dcb2c3052a338c52cf888cec789e66cb8e887 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 524a235ef4489977b6673864aaf8d3e9ed4a6e93..39244971c26480ef7c0ff02a9e7e36891352ba22 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 f46c0f02d6301ba80860ab83de0a66b8e3679d4a..1893844314288b594194be0f1a07c1907fb18595 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 7041e5b8f41c4bcf3641ad6574967cafdff4e00f..6e1cb7aba905173bfd1f5a48ddda8b6d10a61413 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 54ca3427a0b636bce0d5dcb260fd5344d1c7d51e..e3b4d176cf0fbceb0830679e1b0fe4547002e4a7 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 38afc969140bd9ac24f4a0f305c01b61895877f3..ac6c3290ff19f17055c4ceab71969e850e93ba7d 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 c593bcf76b351bbcbe7ca03426f25d29f3998296..8dbb7a9752fb5905168b9c6eb2280f6f025a7309 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 482e8f9c7cbdc913a13729b5529ac21df072a521..24b3df5a874d951bc1b253c6b81f7cb4aa426066 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 0000000000000000000000000000000000000000..77592648e3f3be87d6c7123eb81cbad75f9aef5a --- /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 0000000000000000000000000000000000000000..ec44c6c1675c25b9827aacd08c02433cccde7780 --- /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 0000000000000000000000000000000000000000..9f75c5aa851cd877fb0d93ccc31b8567a6706546 --- /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 0000000000000000000000000000000000000000..0bccaabfc6fda5b04d7460110ae075b7eebe9d2a --- /dev/null +++ b/third-party/protobuf-mobile @@ -0,0 +1 @@ +Subproject commit 0bccaabfc6fda5b04d7460110ae075b7eebe9d2a