Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
01de2fc9
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
01de2fc9
编写于
4月 19, 2023
作者:
Y
Yuanle Liu
提交者:
GitHub
4月 19, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove c++14 assert and remove include tensor.h in phi (#53050)
* remove c++14 assert and remove include tensor.h in phi
上级
eba057e3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
24 deletion
+37
-24
cmake/phi_header.cmake
cmake/phi_header.cmake
+28
-16
paddle/extension.h
paddle/extension.h
+1
-1
paddle/fluid/inference/api/analysis_predictor.cc
paddle/fluid/inference/api/analysis_predictor.cc
+1
-1
paddle/fluid/inference/api/paddle_tensor.h
paddle/fluid/inference/api/paddle_tensor.h
+4
-2
paddle/fluid/platform/init_phi.h
paddle/fluid/platform/init_phi.h
+3
-0
paddle/phi/api/all.h
paddle/phi/api/all.h
+0
-4
未找到文件。
cmake/phi_header.cmake
浏览文件 @
01de2fc9
...
...
@@ -17,21 +17,24 @@ set(PADDLE_INFERENCE_INSTALL_DIR
function
(
phi_header_path_compat TARGET_PATH
)
message
(
STATUS
"phi header path compat processing:
${
TARGET_PATH
}
"
)
file
(
GLOB HEADERS
"
${
TARGET_PATH
}
/*"
"*.h"
)
foreach
(
header
${
HEADERS
}
)
if
(
${
header
}
MATCHES
".*.h$"
)
file
(
READ
${
header
}
HEADER_CONTENT
)
string
(
REPLACE
"paddle/phi/"
"paddle/include/experimental/phi/"
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
string
(
REPLACE
"paddle/fluid/platform/"
"paddle/include/experimental/phi/"
HEADER_CONTENT
"
${
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
()
string
(
FIND
${
TARGET_PATH
}
"experimental"
pos
)
if
(
pos GREATER 1
)
file
(
GLOB HEADERS
"
${
TARGET_PATH
}
/*"
"*.h"
)
foreach
(
header
${
HEADERS
}
)
if
(
${
header
}
MATCHES
".*.h$"
)
file
(
READ
${
header
}
HEADER_CONTENT
)
string
(
REPLACE
"paddle/phi/"
"paddle/include/experimental/phi/"
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
string
(
REPLACE
"paddle/fluid/platform/"
"paddle/include/experimental/phi/"
HEADER_CONTENT
"
${
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
()
phi_header_path_compat
(
...
...
@@ -48,7 +51,16 @@ phi_header_path_compat(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/phi/common
)
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/phi/core
)
phi_header_path_compat
(
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/
)
# NOTE(liuyuanle): In inference lib, no need include paddle/utils/pybind.h, so we delete this.
file
(
READ
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/extension.h
HEADER_CONTENT
)
string
(
REGEX REPLACE
"#if !defined
\\
(PADDLE_ON_INFERENCE
\\
).*#endif"
""
HEADER_CONTENT
"
${
HEADER_CONTENT
}
"
)
file
(
WRITE
${
PADDLE_INFERENCE_INSTALL_DIR
}
/paddle/include/experimental/extension.h
"
${
HEADER_CONTENT
}
"
)
# In order to be compatible with the original behavior, the header file name needs to be changed
file
(
RENAME
...
...
paddle/extension.h
浏览文件 @
01de2fc9
...
...
@@ -16,8 +16,8 @@ limitations under the License. */
// All paddle apis in C++ frontend
#include "paddle/phi/api/all.h"
// Python bindings for the C++ frontend (includes Python.h)
#if !defined(PADDLE_ON_INFERENCE) && !defined(PADDLE_NO_PYTHON)
// Python bindings for the C++ frontend (includes Python.h)
#include "paddle/utils/pybind.h"
#endif
// For initialization of DeviceContextPool and MemoryMethod
...
...
paddle/fluid/inference/api/analysis_predictor.cc
浏览文件 @
01de2fc9
...
...
@@ -56,7 +56,7 @@
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/phi/api/
ext/op_meta_info
.h"
#include "paddle/phi/api/
include/tensor
.h"
#include "paddle/phi/common/backend.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/place.h"
...
...
paddle/fluid/inference/api/paddle_tensor.h
浏览文件 @
01de2fc9
...
...
@@ -21,13 +21,15 @@
#include "paddle_infer_declare.h" // NOLINT
#include "paddle/phi/api/include/tensor.h" // expose paddle::Tensor
#ifdef PADDLE_WITH_ONNXRUNTIME
#include "onnxruntime_c_api.h" // NOLINT
#include "onnxruntime_cxx_api.h" // NOLINT
#endif
namespace
paddle
{
class
Tensor
;
}
namespace
paddle_infer
{
/// \brief Experimental.
...
...
paddle/fluid/platform/init_phi.h
浏览文件 @
01de2fc9
...
...
@@ -11,8 +11,11 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include "paddle/phi/api/include/dll_decl.h"
namespace
paddle
{
class
PADDLE_API
InitPhi
{
...
...
paddle/phi/api/all.h
浏览文件 @
01de2fc9
...
...
@@ -14,10 +14,6 @@ limitations under the License. */
#pragma once
#if !defined(_MSC_VER) && __cplusplus < 201402L
#error C++14 or later compatible compiler is required to use Paddle.
#endif
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录