Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c0dcb090
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c0dcb090
编写于
11月 19, 2019
作者:
Z
zhouwei25
提交者:
liuwei1031
11月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Determine whether to copy and link inference lib by ON_INFER (#20931)
上级
2dfcbb8b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
17 deletion
+24
-17
CMakeLists.txt
CMakeLists.txt
+3
-2
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+0
-1
paddle/fluid/inference/CMakeLists.txt
paddle/fluid/inference/CMakeLists.txt
+17
-11
paddle/fluid/inference/api/CMakeLists.txt
paddle/fluid/inference/api/CMakeLists.txt
+0
-1
paddle/fluid/inference/capi/CMakeLists.txt
paddle/fluid/inference/capi/CMakeLists.txt
+4
-2
未找到文件。
CMakeLists.txt
浏览文件 @
c0dcb090
...
...
@@ -66,7 +66,7 @@ option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FO
option
(
WITH_SYSTEM_BLAS
"Use system blas library"
OFF
)
option
(
WITH_DISTRIBUTE
"Compile with distributed support"
OFF
)
option
(
WITH_BRPC_RDMA
"Use brpc rdma as the rpc protocal"
OFF
)
option
(
ON_INFER
"Turn on inference optimization
."
OFF
)
option
(
ON_INFER
"Turn on inference optimization
and inference-lib generation"
OFF
)
################################ Internal Configurations #######################################
option
(
WITH_AMD_GPU
"Compile PaddlePaddle with AMD GPU"
OFF
)
option
(
WITH_NGRAPH
"Compile PaddlePaddle with nGraph support."
OFF
)
...
...
@@ -168,7 +168,6 @@ include(ccache) # set ccache for compilation
include
(
util
)
# set unittest and link libs
include
(
version
)
# set PADDLE_VERSION
include
(
coveralls
)
# set code coverage
include
(
inference_lib
)
# add paddle fluid inference libraries
include
(
configure
)
# add paddle env configuration
include_directories
(
"
${
PADDLE_SOURCE_DIR
}
"
)
...
...
@@ -184,7 +183,9 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"-O3 -g -DNDEBUG"
)
if
(
ON_INFER
)
# you can trun off the paddle fluid and inference lib by set ON_INFER=OFF
message
(
STATUS
"On inference mode, will take place some specific optimization."
)
include
(
inference_lib
)
add_definitions
(
-DPADDLE_ON_INFERENCE
)
else
()
#TODO(luotao), combine this warning with `make inference_lib_dist` command.
...
...
cmake/inference_lib.cmake
浏览文件 @
c0dcb090
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
# make package for paddle fluid shared and static library
set
(
FLUID_INSTALL_DIR
"
${
CMAKE_BINARY_DIR
}
/fluid_install_dir"
CACHE STRING
"A path setting fluid shared and static libraries"
)
...
...
paddle/fluid/inference/CMakeLists.txt
浏览文件 @
c0dcb090
...
...
@@ -38,6 +38,18 @@ endif(WIN32)
add_subdirectory
(
api
)
add_subdirectory
(
capi
)
if
(
WITH_TESTING
)
# tests/book depends the models that generated by python/paddle/fluid/tests/book
add_subdirectory
(
tests/book
)
if
(
WITH_INFERENCE_API_TEST
)
add_subdirectory
(
tests/api
)
endif
()
endif
()
if
(
NOT ON_INFER
)
return
()
endif
()
if
(
WITH_MKLDNN
)
set
(
mkldnn_quantizer_src
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/mkldnn_quantizer.cc
)
set
(
mkldnn_quantizer_cfg mkldnn_quantizer_config
)
...
...
@@ -59,9 +71,10 @@ if(WIN32)
analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
else
(
WIN32
)
cc_library
(
paddle_fluid DEPS
${
fluid_modules
}
${
STATIC_INFERENCE_APIS
}
zero_copy_tensor reset_tensor_array analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
zero_copy_tensor reset_tensor_array analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
endif
(
WIN32
)
if
(
NOT APPLE
)
# TODO(liuyiqu: Temporarily disable the link flag because it is not support on Mac.
set
(
LINK_FLAGS
"-Wl,--retain-symbols-file
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_fluid.sym"
)
...
...
@@ -72,12 +85,13 @@ endif()
if
(
WIN32
)
sep_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array
analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
else
(
WIN32
)
cc_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array
analysis_config
${
mkldnn_quantizer_cfg
}
paddle_pass_builder
)
endif
()
get_property
(
os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES
)
target_link_libraries
(
paddle_fluid_shared
${
os_dependency_modules
}
)
...
...
@@ -99,11 +113,3 @@ if(NOT APPLE AND NOT WIN32)
DEPENDS paddle_fluid_shared
)
add_custom_target
(
check_symbol ALL DEPENDS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/.check_symbol"
)
endif
()
if
(
WITH_TESTING
)
# tests/book depends the models that generated by python/paddle/fluid/tests/book
add_subdirectory
(
tests/book
)
if
(
WITH_INFERENCE_API_TEST
)
add_subdirectory
(
tests/api
)
endif
()
endif
()
paddle/fluid/inference/api/CMakeLists.txt
浏览文件 @
c0dcb090
...
...
@@ -17,7 +17,6 @@ if(APPLE)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-error=pessimizing-move"
)
endif
(
APPLE
)
set
(
inference_deps
${
analysis_deps
}
paddle_inference_api paddle_fluid_api
analysis pass naive_executor
...
...
paddle/fluid/inference/capi/CMakeLists.txt
浏览文件 @
c0dcb090
set
(
C_API_SRCS pd_config.cc pd_predictor.cc pd_tensor.cc c_api.cc
)
cc_library
(
paddle_fluid_c SRCS
${
C_API_SRCS
}
DEPS paddle_fluid
)
cc_library
(
paddle_fluid_c_shared SHARED SRCS
${
C_API_SRCS
}
DEPS paddle_fluid
)
cc_library
(
paddle_fluid_c SRCS
${
C_API_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api paddle_inference_api analysis_predictor
)
cc_library
(
paddle_fluid_c_shared SHARED SRCS
${
C_API_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api paddle_inference_api analysis_predictor
)
set_target_properties
(
paddle_fluid_c_shared PROPERTIES OUTPUT_NAME paddle_fluid_c
)
if
(
WIN32
)
target_link_libraries
(
paddle_fluid_c_shared shlwapi.lib
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录