Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
e5a76c98
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e5a76c98
编写于
8月 25, 2019
作者:
Y
Yan Chunwei
提交者:
GitHub
8月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
leave tiny-publish out of third-party dependencies (#1853)
上级
6ba3869b
变更
28
显示空白变更内容
内联
并排
Showing
28 changed file
with
90 addition
and
56 deletion
+90
-56
.gitmodules
.gitmodules
+12
-0
CMakeLists.txt
CMakeLists.txt
+10
-10
README_cn.md
README_cn.md
+0
-1
cmake/external/eigen.cmake
cmake/external/eigen.cmake
+2
-2
cmake/external/gflags.cmake
cmake/external/gflags.cmake
+4
-3
cmake/external/gtest.cmake
cmake/external/gtest.cmake
+7
-6
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+12
-7
cmake/lite.cmake
cmake/lite.cmake
+1
-1
lite/CMakeLists.txt
lite/CMakeLists.txt
+0
-1
lite/api/CMakeLists.txt
lite/api/CMakeLists.txt
+2
-2
lite/api/light_api_impl.cc
lite/api/light_api_impl.cc
+1
-1
lite/api/paddle_api.h
lite/api/paddle_api.h
+8
-3
lite/api/paddle_place.h
lite/api/paddle_place.h
+7
-6
lite/api/resnet18_test.cc
lite/api/resnet18_test.cc
+0
-2
lite/core/cpu_info.cc
lite/core/cpu_info.cc
+3
-2
lite/core/mir/subgraph/CMakeLists.txt
lite/core/mir/subgraph/CMakeLists.txt
+1
-1
lite/fluid/CMakeLists.txt
lite/fluid/CMakeLists.txt
+1
-1
lite/kernels/arm/CMakeLists.txt
lite/kernels/arm/CMakeLists.txt
+2
-2
lite/operators/CMakeLists.txt
lite/operators/CMakeLists.txt
+1
-1
lite/tools/build.sh
lite/tools/build.sh
+4
-0
lite/tools/ci_build.sh
lite/tools/ci_build.sh
+3
-0
lite/tools/debug/model_debug_tool.cc
lite/tools/debug/model_debug_tool.cc
+2
-1
lite/utils/logging.h
lite/utils/logging.h
+1
-1
lite/x86/math/CMakeLists.txt
lite/x86/math/CMakeLists.txt
+2
-2
third-party/gflags
third-party/gflags
+1
-0
third-party/googletest
third-party/googletest
+1
-0
third-party/protobuf-host
third-party/protobuf-host
+1
-0
third-party/protobuf-mobile
third-party/protobuf-mobile
+1
-0
未找到文件。
.gitmodules
0 → 100644
浏览文件 @
e5a76c98
[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
CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -109,16 +109,15 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
...
@@ -109,16 +109,15 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
include
(
cross_compiling/postproject
)
include
(
cross_compiling/postproject
)
include
(
cross_compiling/npu
)
# check and prepare NPU DDK
include
(
cross_compiling/npu
)
# check and prepare NPU DDK
# 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 the necessary thirdparty dependencies
include
(
external/gflags
)
# download, build, install gflags
include
(
external/gflags
)
# download, build, install gflags
# LITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON will disable glog
# LITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON will disable glog
# TODO(sangoly): refine WITH_LITE and LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
# 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
(
external/gtest
)
# download, build, install gtest
include
(
ccache
)
# set ccache for compilation
include
(
ccache
)
# set ccache for compilation
if
(
NOT LITE_ON_TINY_PUBLISH
)
include
(
external/protobuf
)
# download, build, install protobuf
include
(
external/protobuf
)
# download, build, install protobuf
endif
()
endif
()
...
@@ -134,6 +133,7 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
...
@@ -134,6 +133,7 @@ if (WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
add_subdirectory
(
lite
)
add_subdirectory
(
lite
)
return
()
return
()
endif
()
endif
()
################################# End of mobile compile ##############################
set
(
WITH_MKLML
${
WITH_MKL
}
)
set
(
WITH_MKLML
${
WITH_MKL
}
)
if
(
NOT DEFINED WITH_MKLDNN
)
if
(
NOT DEFINED WITH_MKLDNN
)
...
...
README_cn.md
浏览文件 @
e5a76c98
...
@@ -51,7 +51,6 @@ Paddle Lite 借鉴了以下开源项目:
...
@@ -51,7 +51,6 @@ Paddle Lite 借鉴了以下开源项目:
-
[
ARM compute library
](
(https://github.com/ARM-software/ComputeLibrary
)
)
-
[
ARM compute library
](
(https://github.com/ARM-software/ComputeLibrary
)
)
-
[
Anakin
](
https://github.com/PaddlePaddle/Anakin
)
,Anakin对应底层的一些优化实现已被集成到Paddle Lite。Anakin作为PaddlePaddle组织下的一个高性能预测项目,极具前瞻性,对Paddle Lite有重要贡献。Anakin已和本项目实现整合。之后,Anakin不再升级。
-
[
Anakin
](
https://github.com/PaddlePaddle/Anakin
)
,Anakin对应底层的一些优化实现已被集成到Paddle Lite。Anakin作为PaddlePaddle组织下的一个高性能预测项目,极具前瞻性,对Paddle Lite有重要贡献。Anakin已和本项目实现整合。之后,Anakin不再升级。
## 交流与反馈
## 交流与反馈
*
欢迎您通过Github Issues来提交问题、报告与建议
*
欢迎您通过Github Issues来提交问题、报告与建议
*
QQ群: 696965088
*
QQ群: 696965088
...
...
cmake/external/eigen.cmake
浏览文件 @
e5a76c98
cmake/external/gflags.cmake
浏览文件 @
e5a76c98
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
INCLUDE
(
ExternalProject
)
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_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/gflags
)
SET
(
GFLAGS_INCLUDE_DIR
"
${
GFLAGS_INSTALL_DIR
}
/include"
CACHE PATH
"gflags include directory."
FORCE
)
SET
(
GFLAGS_INCLUDE_DIR
"
${
GFLAGS_INSTALL_DIR
}
/include"
CACHE PATH
"gflags include directory."
FORCE
)
IF
(
WIN32
)
IF
(
WIN32
)
...
@@ -37,9 +37,10 @@ SET(OPTIONAL_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
...
@@ -37,9 +37,10 @@ SET(OPTIONAL_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
ExternalProject_Add
(
ExternalProject_Add
(
extern_gflags
extern_gflags
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
GIT_REPOSITORY
"
https://github.com/gflags/gflags.git
"
GIT_REPOSITORY
""
GIT_TAG 77592648e3f3be87d6c7123eb81cbad75f9aef5a
GIT_TAG 77592648e3f3be87d6c7123eb81cbad75f9aef5a
PREFIX
${
GFLAGS_SOURCES_DIR
}
SOURCE_DIR
${
GFLAGS_SOURCES_DIR
}
PREFIX
${
GFLAGS_INCLUDE_DIR
}
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CMAKE_ARGS -DBUILD_STATIC_LIBS=ON
CMAKE_ARGS -DBUILD_STATIC_LIBS=ON
-DCMAKE_INSTALL_PREFIX=
${
GFLAGS_INSTALL_DIR
}
-DCMAKE_INSTALL_PREFIX=
${
GFLAGS_INSTALL_DIR
}
...
...
cmake/external/gtest.cmake
浏览文件 @
e5a76c98
...
@@ -12,15 +12,15 @@
...
@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
FIXME:(gongwb) Move brpc's gtest dependency.
#
the gtest is only used when WITH_TESTING=ON
IF
(
WITH_TESTING
OR
(
WITH_DISTRIBUTE AND NOT WITH_GRPC
)
)
IF
(
WITH_TESTING
)
IF
(
WITH_TESTING
)
IF
(
WITH_TESTING
)
ENABLE_TESTING
()
ENABLE_TESTING
()
ENDIF
(
WITH_TESTING
)
ENDIF
(
WITH_TESTING
)
INCLUDE
(
ExternalProject
)
INCLUDE
(
ExternalProject
)
SET
(
GTEST_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/g
test
)
SET
(
GTEST_SOURCES_DIR
${
CMAKE_SOURCE_DIR
}
/third-party/google
test
)
SET
(
GTEST_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/gtest
)
SET
(
GTEST_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/gtest
)
SET
(
GTEST_INCLUDE_DIR
"
${
GTEST_INSTALL_DIR
}
/include"
CACHE PATH
"gtest include directory."
FORCE
)
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))
...
@@ -56,9 +56,10 @@ IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC))
extern_gtest
extern_gtest
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
DEPENDS
${
GTEST_DEPENDS
}
DEPENDS
${
GTEST_DEPENDS
}
GIT_REPOSITORY
"https://github.com/google/googletest.git"
GIT_REPOSITORY
""
SOURCE_DIR
${
GTEST_SOURCES_DIR
}
GIT_TAG
"release-1.8.0"
GIT_TAG
"release-1.8.0"
PREFIX
${
GTEST_
SOURCES
_DIR
}
PREFIX
${
GTEST_
INSTALL
_DIR
}
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CMAKE_ARGS
${
CROSS_COMPILE_CMAKE_ARGS
}
CMAKE_ARGS
${
CROSS_COMPILE_CMAKE_ARGS
}
${
OPTIONAL_ARGS
}
${
OPTIONAL_ARGS
}
...
@@ -82,4 +83,4 @@ IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC))
...
@@ -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
}
)
SET_PROPERTY
(
TARGET gtest_main PROPERTY IMPORTED_LOCATION
${
GTEST_MAIN_LIBRARIES
}
)
ADD_DEPENDENCIES
(
gtest_main extern_gtest
)
ADD_DEPENDENCIES
(
gtest_main extern_gtest
)
ENDIF
(
WITH_TESTING
OR
(
WITH_DISTRIBUTE AND NOT WITH_GRPC
)
)
ENDIF
()
cmake/external/protobuf.cmake
浏览文件 @
e5a76c98
...
@@ -177,10 +177,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -177,10 +177,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
"
${
PROTOBUF_INSTALL_DIR
}
/bin/protoc
${
CMAKE_EXECUTABLE_SUFFIX
}
"
"
${
PROTOBUF_INSTALL_DIR
}
/bin/protoc
${
CMAKE_EXECUTABLE_SUFFIX
}
"
PARENT_SCOPE
)
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
(
PROTOBUF_TAG
"9f75c5aa851cd877fb0d93ccc31b8567a6706546"
)
SET
(
OPTIONAL_CACHE_ARGS
""
)
SET
(
OPTIONAL_CACHE_ARGS
""
)
SET
(
OPTIONAL_ARGS
""
)
SET
(
OPTIONAL_ARGS
""
)
SET
(
SOURCE_DIR
"
${
CMAKE_SOURCE_DIR
}
/third-party/protobuf-host"
)
IF
(
BUILD_FOR_HOST
)
IF
(
BUILD_FOR_HOST
)
SET
(
OPTIONAL_ARGS
SET
(
OPTIONAL_ARGS
...
@@ -191,8 +193,10 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -191,8 +193,10 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
SET
(
OPTIONAL_CACHE_ARGS
"-DZLIB_ROOT:STRING=
${
ZLIB_ROOT
}
"
)
SET
(
OPTIONAL_CACHE_ARGS
"-DZLIB_ROOT:STRING=
${
ZLIB_ROOT
}
"
)
ELSE
()
ELSE
()
# protobuf have compile issue when use android stl c++_static
# 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
(
PROTOBUF_TAG
"mobile"
)
SET
(
SOURCE_DIR
"
${
CMAKE_SOURCE_DIR
}
/third-party/protobuf-mobile"
)
SET
(
OPTIONAL_ARGS
"-Dprotobuf_WITH_ZLIB=OFF"
SET
(
OPTIONAL_ARGS
"-Dprotobuf_WITH_ZLIB=OFF"
${
CROSS_COMPILE_CMAKE_ARGS
}
${
CROSS_COMPILE_CMAKE_ARGS
}
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
...
@@ -215,8 +219,9 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -215,8 +219,9 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
PREFIX
${
PROTOBUF_SOURCES_DIR
}
PREFIX
${
PROTOBUF_SOURCES_DIR
}
SOURCE_SUBDIR cmake
SOURCE_SUBDIR cmake
UPDATE_COMMAND
""
UPDATE_COMMAND
""
GIT_REPOSITORY
${
PROTOBUF_REPO
}
GIT_REPOSITORY
""
GIT_TAG
${
PROTOBUF_TAG
}
GIT_TAG
${
PROTOBUF_TAG
}
SOURCE_DIR
${
SOURCE_DIR
}
CMAKE_ARGS
CMAKE_ARGS
${
OPTIONAL_ARGS
}
${
OPTIONAL_ARGS
}
-Dprotobuf_BUILD_TESTS=OFF
-Dprotobuf_BUILD_TESTS=OFF
...
@@ -237,12 +242,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -237,12 +242,12 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
ExternalProject_Add
(
ExternalProject_Add
(
${
TARGET_NAME
}
${
TARGET_NAME
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
PROTOBUF_SOURCES
_DIR
}
PREFIX
${
SOURCE
_DIR
}
UPDATE_COMMAND
""
UPDATE_COMMAND
""
GIT_REPOSITORY
${
PROTOBUF_REPO
}
GIT_REPOSITORY
""
GIT_TAG
${
PROTOBUF_TAG
}
GIT_TAG
${
PROTOBUF_TAG
}
CONFIGURE_COMMAND
SOURCE_DIR
${
SOURCE_DIR
}
${
CMAKE_COMMAND
}
${
PROTOBUF_SOURCES_DIR
}
/src/
${
TARGET_NAME
}
/cmake
CONFIGURE_COMMAND
${
CMAKE_COMMAND
}
${
SOURCE_DIR
}
/cmake
${
OPTIONAL_ARGS
}
${
OPTIONAL_ARGS
}
-Dprotobuf_BUILD_TESTS=OFF
-Dprotobuf_BUILD_TESTS=OFF
-DCMAKE_SKIP_RPATH=ON
-DCMAKE_SKIP_RPATH=ON
...
...
cmake/lite.cmake
浏览文件 @
e5a76c98
...
@@ -368,7 +368,7 @@ function(bundle_static_library tgt_name bundled_tgt_name fake_target)
...
@@ -368,7 +368,7 @@ function(bundle_static_library tgt_name bundled_tgt_name fake_target)
set
(
bundled_tgt_full_name
set
(
bundled_tgt_full_name
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_STATIC_LIBRARY_PREFIX
}${
bundled_tgt_name
}${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
${
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
)
if
(
NOT IOS
)
file
(
WRITE
${
CMAKE_BINARY_DIR
}
/
${
bundled_tgt_name
}
.ar.in
file
(
WRITE
${
CMAKE_BINARY_DIR
}
/
${
bundled_tgt_name
}
.ar.in
...
...
lite/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -10,7 +10,6 @@ message(STATUS "LITE_WITH_FPGA:\t${LITE_WITH_FPGA}")
...
@@ -10,7 +10,6 @@ message(STATUS "LITE_WITH_FPGA:\t${LITE_WITH_FPGA}")
message
(
STATUS
"LITE_WITH_PROFILE:
\t
${
LITE_WITH_PROFILE
}
"
)
message
(
STATUS
"LITE_WITH_PROFILE:
\t
${
LITE_WITH_PROFILE
}
"
)
set
(
LITE_MODEL_DIR
"
${
THIRD_PARTY_PATH
}
/install"
)
set
(
LITE_MODEL_DIR
"
${
THIRD_PARTY_PATH
}
/install"
)
set
(
LITE_ON_MOBILE
${
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
}
)
set
(
LITE_ON_MOBILE
${
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
}
)
add_subdirectory
(
utils
)
add_subdirectory
(
utils
)
...
...
lite/api/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -128,7 +128,7 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND WITH_TESTING)
...
@@ -128,7 +128,7 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND WITH_TESTING)
set_target_properties
(
test_mobilenetv2 PROPERTIES LINK_FLAGS
"
${
LINK_FLAGS
}
"
)
set_target_properties
(
test_mobilenetv2 PROPERTIES LINK_FLAGS
"
${
LINK_FLAGS
}
"
)
lite_cc_test
(
test_resnet50 SRCS resnet50_test.cc
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
}
CL_DEPS
${
opencl_kernels
}
FPGA_DEPS
${
fpga_kernels
}
FPGA_DEPS
${
fpga_kernels
}
ARGS --cl_path=
${
CMAKE_SOURCE_DIR
}
/lite/opencl
ARGS --cl_path=
${
CMAKE_SOURCE_DIR
}
/lite/opencl
...
...
lite/api/light_api_impl.cc
浏览文件 @
e5a76c98
...
@@ -39,7 +39,7 @@ class LightPredictorImpl : public PaddlePredictor {
...
@@ -39,7 +39,7 @@ class LightPredictorImpl : public PaddlePredictor {
};
};
void
LightPredictorImpl
::
Init
(
const
MobileConfig
&
config
)
{
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
#ifdef LITE_WITH_ARM
lite
::
DeviceInfo
::
Init
();
lite
::
DeviceInfo
::
Init
();
lite
::
DeviceInfo
::
Global
().
SetRunMode
(
config
.
power_mode
(),
config
.
threads
());
lite
::
DeviceInfo
::
Global
().
SetRunMode
(
config
.
power_mode
(),
config
.
threads
());
...
...
lite/api/paddle_api.h
浏览文件 @
e5a76c98
...
@@ -113,9 +113,14 @@ class LITE_API CxxConfig : public ConfigBase {
...
@@ -113,9 +113,14 @@ class LITE_API CxxConfig : public ConfigBase {
class
LITE_API
MobileConfig
:
public
ConfigBase
{
class
LITE_API
MobileConfig
:
public
ConfigBase
{
PowerMode
mode_
{
LITE_POWER_HIGH
};
PowerMode
mode_
{
LITE_POWER_HIGH
};
int
threads_
{
1
};
int
threads_
{
1
};
public:
MobileConfig
(
Place
preferred_place
=
Place
(
TARGET
(
kARM
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNCHW
)),
public:
PowerMode
mode
=
LITE_POWER_HIGH
,
int
threads
=
1
)
:
mode_
(
mode
),
threads_
(
threads
)
{}
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_power_mode
(
PowerMode
mode
)
{
mode_
=
mode
;
}
void
set_threads
(
int
threads
)
{
threads_
=
threads
;
}
void
set_threads
(
int
threads
)
{
threads_
=
threads
;
}
...
...
lite/api/paddle_place.h
浏览文件 @
e5a76c98
...
@@ -70,6 +70,7 @@ enum class DataLayoutType : int {
...
@@ -70,6 +70,7 @@ enum class DataLayoutType : int {
kAny
=
2
,
// any data layout
kAny
=
2
,
// any data layout
NUM
=
4
,
// number of fields.
NUM
=
4
,
// number of fields.
};
};
typedef
enum
{
typedef
enum
{
LITE_POWER_HIGH
=
0
,
LITE_POWER_HIGH
=
0
,
LITE_POWER_LOW
=
1
,
LITE_POWER_LOW
=
1
,
...
...
lite/api/resnet18_test.cc
浏览文件 @
e5a76c98
...
@@ -27,8 +27,6 @@ namespace lite {
...
@@ -27,8 +27,6 @@ namespace lite {
#ifdef LITE_WITH_ARM
#ifdef LITE_WITH_ARM
TEST
(
ResNet18
,
test
)
{
TEST
(
ResNet18
,
test
)
{
DeviceInfo
::
Init
();
DeviceInfo
::
Global
().
SetRunMode
(
lite_api
::
LITE_POWER_HIGH
,
FLAGS_threads
);
lite
::
Predictor
predictor
;
lite
::
Predictor
predictor
;
std
::
vector
<
Place
>
valid_places
({
Place
{
TARGET
(
kHost
),
PRECISION
(
kFloat
)},
std
::
vector
<
Place
>
valid_places
({
Place
{
TARGET
(
kHost
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kARM
),
PRECISION
(
kFloat
)}});
Place
{
TARGET
(
kARM
),
PRECISION
(
kFloat
)}});
...
...
lite/core/cpu_info.cc
浏览文件 @
e5a76c98
...
@@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) {
...
@@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) {
int
little_core_size
=
little_core_ids_
.
size
();
int
little_core_size
=
little_core_ids_
.
size
();
active_ids_
.
clear
();
active_ids_
.
clear
();
if
(
big_core_size
>
0
)
{
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
)
{
if
(
thread_num
>
big_core_size
)
{
LOG
(
ERROR
)
<<
"Request thread num: "
<<
thread_num
LOG
(
ERROR
)
<<
"Request thread num: "
<<
thread_num
<<
", exceed the big cores size: "
<<
big_core_size
<<
", exceed the big cores size: "
<<
big_core_size
...
@@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() {
...
@@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() {
}
}
LOG
(
INFO
)
<<
"Total memory: "
<<
mem_size_
<<
"KB"
;
LOG
(
INFO
)
<<
"Total memory: "
<<
mem_size_
<<
"KB"
;
// set default run mode
// 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
;
return
0
;
}
}
...
...
lite/core/mir/subgraph/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -31,4 +31,4 @@ if(LITE_WITH_NPU)
...
@@ -31,4 +31,4 @@ if(LITE_WITH_NPU)
endif
()
endif
()
set
(
subgraph_passes
${
subgraph_passes
}
CACHE INTERNAL
"subgraph_passes"
)
set
(
subgraph_passes
${
subgraph_passes
}
CACHE INTERNAL
"subgraph_passes"
)
message
(
STATUS
"
+++++
subgraph_passes:
${
subgraph_passes
}
"
)
message
(
STATUS
"
---->
subgraph_passes:
${
subgraph_passes
}
"
)
lite/fluid/CMakeLists.txt
浏览文件 @
e5a76c98
if
(
LITE_WITH_X86
)
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)
# lite_cc_library(selected_rows SRCS selected_rows.cc)
endif
()
endif
()
lite/kernels/arm/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -43,10 +43,10 @@ add_kernel(squeeze_compute_arm ARM basic SRCS squeeze_compute.cc DEPS ${lite_ker
...
@@ -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
(
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
(
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
(
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
# 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_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
(
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
)
add_kernel
(
beam_search_decode_compute_arm ARM extra SRCS beam_search_decode_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
...
...
lite/operators/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -58,9 +58,9 @@ add_operator(norm_op basic SRCS norm_op.cc DEPS ${op_DEPS})
...
@@ -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
(
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
(
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
(
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
# 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
(
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
(
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
}
)
add_operator
(
beam_search_decode_op extra SRCS beam_search_decode_op.cc DEPS
${
op_DEPS
}
)
...
...
lite/tools/build.sh
浏览文件 @
e5a76c98
...
@@ -58,6 +58,8 @@ function make_full_publish_so {
...
@@ -58,6 +58,8 @@ function make_full_publish_so {
local
lang
=
$3
local
lang
=
$3
local
android_stl
=
$4
local
android_stl
=
$4
git submodule update
--init
--recursive
cur_dir
=
$(
pwd
)
cur_dir
=
$(
pwd
)
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
if
[
-d
$build_dir
]
if
[
-d
$build_dir
]
...
@@ -85,6 +87,7 @@ function make_all_tests {
...
@@ -85,6 +87,7 @@ function make_all_tests {
local
abi
=
$2
local
abi
=
$2
local
lang
=
$3
local
lang
=
$3
git submodule update
--init
--recursive
cur_dir
=
$(
pwd
)
cur_dir
=
$(
pwd
)
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
if
[
-d
$build_dir
]
if
[
-d
$build_dir
]
...
@@ -106,6 +109,7 @@ function make_all_tests {
...
@@ -106,6 +109,7 @@ function make_all_tests {
function
print_usage
{
function
print_usage
{
set
+x
echo
-e
"
\n
USAGE:"
echo
-e
"
\n
USAGE:"
echo
echo
echo
"----------------------------------------"
echo
"----------------------------------------"
...
...
lite/tools/ci_build.sh
浏览文件 @
e5a76c98
...
@@ -22,6 +22,9 @@ function prepare_workspace {
...
@@ -22,6 +22,9 @@ function prepare_workspace {
DEBUG_TOOL_PATH_PREFIX
=
lite/tools/debug
DEBUG_TOOL_PATH_PREFIX
=
lite/tools/debug
mkdir
-p
./
${
DEBUG_TOOL_PATH_PREFIX
}
mkdir
-p
./
${
DEBUG_TOOL_PATH_PREFIX
}
cp
../
${
DEBUG_TOOL_PATH_PREFIX
}
/analysis_tool.py ./
${
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
{
function
check_need_ci
{
...
...
lite/tools/debug/model_debug_tool.cc
浏览文件 @
e5a76c98
...
@@ -33,7 +33,8 @@ void Run(DebugConfig* conf) {
...
@@ -33,7 +33,8 @@ void Run(DebugConfig* conf) {
CHECK
(
conf
);
CHECK
(
conf
);
#ifdef LITE_WITH_ARM
#ifdef LITE_WITH_ARM
DeviceInfo
::
Init
();
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
#endif
lite
::
Predictor
predictor
;
lite
::
Predictor
predictor
;
std
::
vector
<
Place
>
valid_places
({
std
::
vector
<
Place
>
valid_places
({
...
...
lite/utils/logging.h
浏览文件 @
e5a76c98
...
@@ -18,13 +18,13 @@
...
@@ -18,13 +18,13 @@
*/
*/
#pragma once
#pragma once
#include <assert.h>
#include <sys/time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/types.h>
#include <time.h>
#include <time.h>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <string>
#include <string>
#include <assert.h>
#include "lite/utils/replace_stl/stream.h"
#include "lite/utils/replace_stl/stream.h"
// NOLINTFILE()
// NOLINTFILE()
...
...
lite/x86/math/CMakeLists.txt
浏览文件 @
e5a76c98
...
@@ -16,7 +16,7 @@ function(math_library TARGET)
...
@@ -16,7 +16,7 @@ function(math_library TARGET)
endif
()
endif
()
list
(
LENGTH cc_srcs cc_srcs_len
)
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
()
endfunction
()
# please add new math_library in alphabetical order
# please add new math_library in alphabetical order
...
@@ -32,7 +32,7 @@ math_library(sampler)
...
@@ -32,7 +32,7 @@ math_library(sampler)
math_library
(
gru_compute DEPS activation_functions math_function
)
math_library
(
gru_compute DEPS activation_functions math_function
)
## math_library(lstm_compute DEPS activation_functions)
## 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
(
math_function DEPS blas
)
math_library
(
maxouting
)
math_library
(
maxouting
)
math_library
(
pooling
)
math_library
(
pooling
)
...
...
gflags
@
77592648
Subproject commit 77592648e3f3be87d6c7123eb81cbad75f9aef5a
googletest
@
ec44c6c1
Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780
protobuf-host
@
9f75c5aa
Subproject commit 9f75c5aa851cd877fb0d93ccc31b8567a6706546
protobuf-mobile
@
0bccaabf
Subproject commit 0bccaabfc6fda5b04d7460110ae075b7eebe9d2a
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录