Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9b0f621c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
9b0f621c
编写于
5月 18, 2023
作者:
Y
Yuanle Liu
提交者:
GitHub
5月 18, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust inference lib dir (#53091)
上级
c3c85794
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
57 deletion
+33
-57
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+13
-15
cmake/phi_header.cmake
cmake/phi_header.cmake
+19
-40
paddle/fluid/inference/CMakeLists.txt
paddle/fluid/inference/CMakeLists.txt
+1
-2
未找到文件。
cmake/inference_lib.cmake
浏览文件 @
9b0f621c
...
@@ -285,58 +285,56 @@ include_directories(${CMAKE_BINARY_DIR}/../paddle/fluid/framework/io)
...
@@ -285,58 +285,56 @@ include_directories(${CMAKE_BINARY_DIR}/../paddle/fluid/framework/io)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/ext/*.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/ext/*.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/api/ext/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/api/ext/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/include/*.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/include/*.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/phi/api/include/
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/paddle/phi/api/include/
)
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/all.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/api/all.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/api/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/api/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/common/*.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/common/*.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/common/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/common/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/macros.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/macros.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/core/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/core/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/visit_type.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/visit_type.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/core/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/core/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/hostdevice.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/phi/core/hostdevice.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/core/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/core/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/platform/init_phi.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/platform/init_phi.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/phi/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/phi/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/any.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/any.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/utils/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/utils/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/optional.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/optional.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/utils/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/utils/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/none.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/none.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/utils/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/utils/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/flat_hash_map.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/utils/flat_hash_map.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/utils/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/utils/
)
copy
(
copy
(
inference_lib_dist
inference_lib_dist
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/extension.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/extension.h
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
/
)
DSTS
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle
/
)
# the header file of phi is copied to the experimental directory,
# the include path of phi needs to be changed to adapt to inference api path
# the include path of phi needs to be changed to adapt to inference api path
add_custom_command
(
add_custom_command
(
TARGET inference_lib_dist
TARGET inference_lib_dist
...
...
cmake/phi_header.cmake
浏览文件 @
9b0f621c
...
@@ -17,57 +17,36 @@ set(PADDLE_INFERENCE_INSTALL_DIR
...
@@ -17,57 +17,36 @@ set(PADDLE_INFERENCE_INSTALL_DIR
function
(
phi_header_path_compat TARGET_PATH
)
function
(
phi_header_path_compat TARGET_PATH
)
message
(
STATUS
"phi header path compat processing:
${
TARGET_PATH
}
"
)
message
(
STATUS
"phi header path compat processing:
${
TARGET_PATH
}
"
)
string
(
FIND
${
TARGET_PATH
}
"experimental"
pos
)
file
(
GLOB HEADERS
"
${
TARGET_PATH
}
/*"
"*.h"
)
if
(
pos GREATER 1
)
foreach
(
header
${
HEADERS
}
)
file
(
GLOB HEADERS
"
${
TARGET_PATH
}
/*"
"*.h"
)
if
(
${
header
}
MATCHES
".*.h$"
)
foreach
(
header
${
HEADERS
}
)
file
(
READ
${
header
}
HEADER_CONTENT
)
if
(
${
header
}
MATCHES
".*.h$"
)
string
(
REPLACE
"paddle/fluid/platform/"
"paddle/phi/"
HEADER_CONTENT
file
(
READ
${
header
}
HEADER_CONTENT
)
"
${
HEADER_CONTENT
}
"
)
string
(
REPLACE
"paddle/phi/"
"paddle/include/experimental/phi/"
file
(
WRITE
${
header
}
"
${
HEADER_CONTENT
}
"
)
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
message
(
STATUS
"phi header path compat processing complete:
${
header
}
"
)
string
(
REPLACE
"paddle/fluid/platform/"
endif
()
"paddle/include/experimental/phi/"
HEADER_CONTENT
endforeach
()
"
${
HEADER_CONTENT
}
"
)
string
(
REPLACE
"paddle/utils/"
"paddle/include/experimental/utils/"
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
file
(
WRITE
${
header
}
"
${
HEADER_CONTENT
}
"
)
message
(
STATUS
"phi header path compat processing complete:
${
header
}
"
)
endif
()
endforeach
()
endif
()
endfunction
()
endfunction
()
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/paddle
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle/phi
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental/ph
i
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle/phi/ap
i
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental/phi/api
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle/phi/api/ext
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental/phi/api/ext
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle/phi/api/include
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
experimental/phi/api/include
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
paddle/phi/common
)
phi_header_path_compat
(
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/phi/common
)
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/paddle/phi/core
)
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/phi/core
)
# NOTE(liuyuanle): In inference lib, no need include paddle/utils/pybind.h, so we delete this.
# NOTE(liuyuanle): In inference lib, no need include paddle/utils/pybind.h, so we delete this.
file
(
READ
file
(
READ
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/paddle/extension.h
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/extension.h
HEADER_CONTENT
)
HEADER_CONTENT
)
string
(
REGEX REPLACE
"#if !defined
\\
(PADDLE_ON_INFERENCE
\\
).*#endif"
""
string
(
REGEX REPLACE
"#if !defined
\\
(PADDLE_ON_INFERENCE
\\
).*#endif"
""
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
file
(
WRITE
file
(
WRITE
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/paddle/extension.h
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/extension.h
"
${
HEADER_CONTENT
}
"
)
"
${
HEADER_CONTENT
}
"
)
# In order to be compatible with the original behavior, the header file name needs to be changed
file
(
RENAME
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/extension.h
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/ext_all.h
)
# Included header file of training and inference can be unified as single file: paddle/extension.h
file
(
COPY
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/ext_all.h
DESTINATION
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle
)
file
(
RENAME
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/ext_all.h
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/extension.h
)
paddle/fluid/inference/CMakeLists.txt
浏览文件 @
9b0f621c
...
@@ -98,8 +98,7 @@ set(SHARED_INFERENCE_SRCS
...
@@ -98,8 +98,7 @@ set(SHARED_INFERENCE_SRCS
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/analysis_predictor.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/analysis_predictor.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/paddle_infer_contrib.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/paddle_infer_contrib.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/details/zero_copy_tensor.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/api/details/zero_copy_tensor.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils/io_utils.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils/io_utils.cc
)
${
PADDLE_CUSTOM_OP_SRCS
}
)
# shared inference library deps
# shared inference library deps
list
(
REMOVE_ITEM fluid_modules standalone_executor
list
(
REMOVE_ITEM fluid_modules standalone_executor
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录