Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
66cd0bbb
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看板
未验证
提交
66cd0bbb
编写于
12月 06, 2021
作者:
C
Chen Weihang
提交者:
GitHub
12月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename pd_dll_decl to paddle_api (#37876)
上级
a73064f2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
75 addition
and
75 deletion
+75
-75
paddle/pten/api/ext/dll_decl.h
paddle/pten/api/ext/dll_decl.h
+5
-5
paddle/pten/api/ext/op_meta_info.h
paddle/pten/api/ext/op_meta_info.h
+4
-4
paddle/pten/api/include/tensor.h
paddle/pten/api/include/tensor.h
+1
-1
paddle/pten/api/include/utils.h
paddle/pten/api/include/utils.h
+1
-1
paddle/pten/api/lib/api_registry.h
paddle/pten/api/lib/api_registry.h
+3
-3
paddle/pten/api/lib/tensor.cc
paddle/pten/api/lib/tensor.cc
+57
-57
paddle/pten/api/lib/utils.cc
paddle/pten/api/lib/utils.cc
+1
-1
python/paddle/utils/code_gen/api_gen.py
python/paddle/utils/code_gen/api_gen.py
+3
-3
未找到文件。
paddle/pten/api/ext/dll_decl.h
浏览文件 @
66cd0bbb
...
...
@@ -15,13 +15,13 @@
#pragma once
#if defined(_WIN32)
#ifndef P
D_DLL_DECL
#ifndef P
ADDLE_API
#ifdef PADDLE_DLL_EXPORT
#define P
D_DLL_DECL
__declspec(dllexport)
#define P
ADDLE_API
__declspec(dllexport)
#else
#define P
D_DLL_DECL
__declspec(dllimport)
#define P
ADDLE_API
__declspec(dllimport)
#endif // PADDLE_DLL_EXPORT
#endif // P
D_DLL_DECL
#endif // P
ADDLE_API
#else
#define P
D_DLL_DECL
#define P
ADDLE_API
#endif // _WIN32
paddle/pten/api/ext/op_meta_info.h
浏览文件 @
66cd0bbb
...
...
@@ -33,7 +33,7 @@ limitations under the License. */
namespace
paddle
{
namespace
framework
{
class
P
D_DLL_DECL
OpMetaInfoHelper
;
class
P
ADDLE_API
OpMetaInfoHelper
;
}
// namespace framework
using
Tensor
=
paddle
::
Tensor
;
...
...
@@ -425,7 +425,7 @@ struct InferDtypeFuncImpl<Return (*)(Args...), impl_fn> {
////////////////////// Op Meta Info //////////////////////
class
P
D_DLL_DECL
OpMetaInfo
{
class
P
ADDLE_API
OpMetaInfo
{
public:
explicit
OpMetaInfo
(
const
std
::
string
&
op_name
)
:
name_
(
op_name
)
{}
...
...
@@ -464,7 +464,7 @@ class PD_DLL_DECL OpMetaInfo {
//////////////// Op Meta Info Map /////////////////
class
P
D_DLL_DECL
OpMetaInfoMap
{
class
P
ADDLE_API
OpMetaInfoMap
{
public:
// this function's impl should keep in header file.
// if move to cc file, meta info can not be added
...
...
@@ -488,7 +488,7 @@ class PD_DLL_DECL OpMetaInfoMap {
//////////////// Op Meta Info Builder /////////////////
class
P
D_DLL_DECL
OpMetaInfoBuilder
{
class
P
ADDLE_API
OpMetaInfoBuilder
{
public:
explicit
OpMetaInfoBuilder
(
std
::
string
&&
name
,
size_t
index
);
OpMetaInfoBuilder
&
Inputs
(
std
::
vector
<
std
::
string
>&&
inputs
);
...
...
paddle/pten/api/include/tensor.h
浏览文件 @
66cd0bbb
...
...
@@ -84,7 +84,7 @@ class AbstractAutogradMeta {
* another simple Tensor design may be required for inference.
*/
class
P
D_DLL_DECL
Tensor
final
{
class
P
ADDLE_API
Tensor
final
{
public:
/* Part 1: Construction and destruction methods */
...
...
paddle/pten/api/include/utils.h
浏览文件 @
66cd0bbb
...
...
@@ -21,7 +21,7 @@ namespace paddle {
namespace
experimental
{
// TODO(chenweihang): Replace backend by place when place is ready
P
D_DLL_DECL
Tensor
copy_to
(
const
Tensor
&
x
,
Backend
backend
,
bool
blocking
);
P
ADDLE_API
Tensor
copy_to
(
const
Tensor
&
x
,
Backend
backend
,
bool
blocking
);
}
// namespace experimental
}
// namespace paddle
paddle/pten/api/lib/api_registry.h
浏览文件 @
66cd0bbb
...
...
@@ -37,10 +37,10 @@ namespace experimental {
// use to declare symbol
#define PT_REGISTER_API(name) \
P
D_DLL_DECL
int RegisterSymbolsFor##name() { return 0; }
P
ADDLE_API
int RegisterSymbolsFor##name() { return 0; }
#define PT_DECLARE_API(name)
\
extern P
D_DLL_DECL
int RegisterSymbolsFor##name(); \
#define PT_DECLARE_API(name) \
extern P
ADDLE_API
int RegisterSymbolsFor##name(); \
UNUSED static int use_pten_api_##name = RegisterSymbolsFor##name()
}
// namespace experimental
...
...
paddle/pten/api/lib/tensor.cc
浏览文件 @
66cd0bbb
...
...
@@ -159,19 +159,19 @@ T *Tensor::mutable_data() {
return
nullptr
;
}
template
P
D_DLL_DECL
float
*
Tensor
::
mutable_data
<
float
>();
template
P
D_DLL_DECL
double
*
Tensor
::
mutable_data
<
double
>();
template
P
D_DLL_DECL
int64_t
*
Tensor
::
mutable_data
<
int64_t
>();
template
P
D_DLL_DECL
int32_t
*
Tensor
::
mutable_data
<
int32_t
>();
template
P
D_DLL_DECL
uint8_t
*
Tensor
::
mutable_data
<
uint8_t
>();
template
P
D_DLL_DECL
int8_t
*
Tensor
::
mutable_data
<
int8_t
>();
template
P
D_DLL_DECL
int16_t
*
Tensor
::
mutable_data
<
int16_t
>();
template
P
D_DLL_DECL
bool
*
Tensor
::
mutable_data
<
bool
>();
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
float
>
template
P
ADDLE_API
float
*
Tensor
::
mutable_data
<
float
>();
template
P
ADDLE_API
double
*
Tensor
::
mutable_data
<
double
>();
template
P
ADDLE_API
int64_t
*
Tensor
::
mutable_data
<
int64_t
>();
template
P
ADDLE_API
int32_t
*
Tensor
::
mutable_data
<
int32_t
>();
template
P
ADDLE_API
uint8_t
*
Tensor
::
mutable_data
<
uint8_t
>();
template
P
ADDLE_API
int8_t
*
Tensor
::
mutable_data
<
int8_t
>();
template
P
ADDLE_API
int16_t
*
Tensor
::
mutable_data
<
int16_t
>();
template
P
ADDLE_API
bool
*
Tensor
::
mutable_data
<
bool
>();
template
P
ADDLE_API
paddle
::
platform
::
complex
<
float
>
*
Tensor
::
mutable_data
<
paddle
::
platform
::
complex
<
float
>>
();
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
double
>
template
P
ADDLE_API
paddle
::
platform
::
complex
<
double
>
*
Tensor
::
mutable_data
<
paddle
::
platform
::
complex
<
double
>>
();
template
P
D_DLL_DECL
paddle
::
platform
::
float16
*
template
P
ADDLE_API
paddle
::
platform
::
float16
*
Tensor
::
mutable_data
<
paddle
::
platform
::
float16
>();
template
<
typename
T
>
...
...
@@ -185,25 +185,25 @@ T *Tensor::mutable_data(const PlaceType &place) {
return
mutable_data
<
T
>
();
}
template
P
D_DLL_DECL
float
*
Tensor
::
mutable_data
<
float
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
double
*
Tensor
::
mutable_data
<
double
>(
template
P
ADDLE_API
float
*
Tensor
::
mutable_data
<
float
>(
const
PlaceType
&
place
);
template
P
ADDLE_API
double
*
Tensor
::
mutable_data
<
double
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
int64_t
*
Tensor
::
mutable_data
<
int64_t
>(
template
P
ADDLE_API
int64_t
*
Tensor
::
mutable_data
<
int64_t
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
int32_t
*
Tensor
::
mutable_data
<
int32_t
>(
template
P
ADDLE_API
int32_t
*
Tensor
::
mutable_data
<
int32_t
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
uint8_t
*
Tensor
::
mutable_data
<
uint8_t
>(
template
P
ADDLE_API
uint8_t
*
Tensor
::
mutable_data
<
uint8_t
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
int8_t
*
Tensor
::
mutable_data
<
int8_t
>(
template
P
ADDLE_API
int8_t
*
Tensor
::
mutable_data
<
int8_t
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
int16_t
*
Tensor
::
mutable_data
<
int16_t
>(
template
P
ADDLE_API
int16_t
*
Tensor
::
mutable_data
<
int16_t
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
bool
*
Tensor
::
mutable_data
<
bool
>(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
float
>
*
template
P
ADDLE_API
bool
*
Tensor
::
mutable_data
<
bool
>(
const
PlaceType
&
place
);
template
P
ADDLE_API
paddle
::
platform
::
complex
<
float
>
*
Tensor
::
mutable_data
<
paddle
::
platform
::
complex
<
float
>>
(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
double
>
*
template
P
ADDLE_API
paddle
::
platform
::
complex
<
double
>
*
Tensor
::
mutable_data
<
paddle
::
platform
::
complex
<
double
>>
(
const
PlaceType
&
place
);
template
P
D_DLL_DECL
paddle
::
platform
::
float16
*
template
P
ADDLE_API
paddle
::
platform
::
float16
*
Tensor
::
mutable_data
<
paddle
::
platform
::
float16
>(
const
PlaceType
&
place
);
template
<
typename
T
>
...
...
@@ -214,22 +214,22 @@ const T *Tensor::data() const {
return
nullptr
;
}
template
P
D_DLL_DECL
const
float
*
Tensor
::
data
<
float
>()
const
;
template
P
D_DLL_DECL
const
double
*
Tensor
::
data
<
double
>()
const
;
template
P
D_DLL_DECL
const
int64_t
*
Tensor
::
data
<
int64_t
>()
const
;
template
P
D_DLL_DECL
const
int32_t
*
Tensor
::
data
<
int32_t
>()
const
;
template
P
D_DLL_DECL
const
uint8_t
*
Tensor
::
data
<
uint8_t
>()
const
;
template
P
D_DLL_DECL
const
int8_t
*
Tensor
::
data
<
int8_t
>()
const
;
template
P
D_DLL_DECL
const
int16_t
*
Tensor
::
data
<
int16_t
>()
const
;
template
P
D_DLL_DECL
const
uint16_t
*
Tensor
::
data
<
uint16_t
>()
const
;
template
P
D_DLL_DECL
const
bool
*
Tensor
::
data
<
bool
>()
const
;
template
P
D_DLL_DECL
const
paddle
::
platform
::
complex
<
float
>
template
P
ADDLE_API
const
float
*
Tensor
::
data
<
float
>()
const
;
template
P
ADDLE_API
const
double
*
Tensor
::
data
<
double
>()
const
;
template
P
ADDLE_API
const
int64_t
*
Tensor
::
data
<
int64_t
>()
const
;
template
P
ADDLE_API
const
int32_t
*
Tensor
::
data
<
int32_t
>()
const
;
template
P
ADDLE_API
const
uint8_t
*
Tensor
::
data
<
uint8_t
>()
const
;
template
P
ADDLE_API
const
int8_t
*
Tensor
::
data
<
int8_t
>()
const
;
template
P
ADDLE_API
const
int16_t
*
Tensor
::
data
<
int16_t
>()
const
;
template
P
ADDLE_API
const
uint16_t
*
Tensor
::
data
<
uint16_t
>()
const
;
template
P
ADDLE_API
const
bool
*
Tensor
::
data
<
bool
>()
const
;
template
P
ADDLE_API
const
paddle
::
platform
::
complex
<
float
>
*
Tensor
::
data
<
paddle
::
platform
::
complex
<
float
>>
()
const
;
template
P
D_DLL_DECL
const
paddle
::
platform
::
complex
<
double
>
template
P
ADDLE_API
const
paddle
::
platform
::
complex
<
double
>
*
Tensor
::
data
<
paddle
::
platform
::
complex
<
double
>>
()
const
;
template
P
D_DLL_DECL
const
paddle
::
platform
::
float16
*
template
P
ADDLE_API
const
paddle
::
platform
::
float16
*
Tensor
::
data
<
paddle
::
platform
::
float16
>()
const
;
template
P
D_DLL_DECL
const
paddle
::
platform
::
bfloat16
*
template
P
ADDLE_API
const
paddle
::
platform
::
bfloat16
*
Tensor
::
data
<
paddle
::
platform
::
bfloat16
>()
const
;
template
<
typename
T
>
...
...
@@ -241,19 +241,19 @@ T *Tensor::data() {
return
nullptr
;
}
template
P
D_DLL_DECL
float
*
Tensor
::
data
<
float
>();
template
P
D_DLL_DECL
double
*
Tensor
::
data
<
double
>();
template
P
D_DLL_DECL
int64_t
*
Tensor
::
data
<
int64_t
>();
template
P
D_DLL_DECL
int32_t
*
Tensor
::
data
<
int32_t
>();
template
P
D_DLL_DECL
uint8_t
*
Tensor
::
data
<
uint8_t
>();
template
P
D_DLL_DECL
int8_t
*
Tensor
::
data
<
int8_t
>();
template
P
D_DLL_DECL
int16_t
*
Tensor
::
data
<
int16_t
>();
template
P
D_DLL_DECL
bool
*
Tensor
::
data
<
bool
>();
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
float
>
template
P
ADDLE_API
float
*
Tensor
::
data
<
float
>();
template
P
ADDLE_API
double
*
Tensor
::
data
<
double
>();
template
P
ADDLE_API
int64_t
*
Tensor
::
data
<
int64_t
>();
template
P
ADDLE_API
int32_t
*
Tensor
::
data
<
int32_t
>();
template
P
ADDLE_API
uint8_t
*
Tensor
::
data
<
uint8_t
>();
template
P
ADDLE_API
int8_t
*
Tensor
::
data
<
int8_t
>();
template
P
ADDLE_API
int16_t
*
Tensor
::
data
<
int16_t
>();
template
P
ADDLE_API
bool
*
Tensor
::
data
<
bool
>();
template
P
ADDLE_API
paddle
::
platform
::
complex
<
float
>
*
Tensor
::
data
<
paddle
::
platform
::
complex
<
float
>>
();
template
P
D_DLL_DECL
paddle
::
platform
::
complex
<
double
>
template
P
ADDLE_API
paddle
::
platform
::
complex
<
double
>
*
Tensor
::
data
<
paddle
::
platform
::
complex
<
double
>>
();
template
P
D_DLL_DECL
paddle
::
platform
::
float16
*
template
P
ADDLE_API
paddle
::
platform
::
float16
*
Tensor
::
data
<
paddle
::
platform
::
float16
>();
// TODO(chenweihang): replace slice impl by API
...
...
@@ -294,27 +294,27 @@ Tensor Tensor::copy_to(const PlaceType &target_place) const {
return
copy_to
(
ConvertExtPlaceToBackend
(
target_place
),
/*blocking=*/
false
);
}
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
float
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
double
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
int64_t
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
int32_t
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
uint8_t
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
int8_t
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
int16_t
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
bool
>(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
Tensor
::
copy_to
<
paddle
::
platform
::
complex
<
float
>
>
(
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
paddle
::
platform
::
complex
<
float
>
>
(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
Tensor
::
copy_to
<
paddle
::
platform
::
complex
<
double
>
>
(
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
paddle
::
platform
::
complex
<
double
>
>
(
const
PlaceType
&
target_place
)
const
;
template
P
D_DLL_DECL
Tensor
template
P
ADDLE_API
Tensor
Tensor
::
copy_to
<
paddle
::
platform
::
float16
>(
const
PlaceType
&
target_place
)
const
;
Tensor
Tensor
::
copy_to
(
Backend
backend
,
bool
blocking
)
const
{
...
...
paddle/pten/api/lib/utils.cc
浏览文件 @
66cd0bbb
...
...
@@ -34,7 +34,7 @@ PT_DECLARE_MODULE(UtilsCUDA);
namespace
paddle
{
namespace
experimental
{
P
D_DLL_DECL
Tensor
copy_to
(
const
Tensor
&
x
,
Backend
backend
,
bool
blocking
)
{
P
ADDLE_API
Tensor
copy_to
(
const
Tensor
&
x
,
Backend
backend
,
bool
blocking
)
{
// 1. Get kernel signature and kernel
auto
kernel_key_set
=
ParseKernelKeyByInputArgs
(
x
);
kernel_key_set
.
backend_set
=
kernel_key_set
.
backend_set
|
BackendSet
(
backend
);
...
...
python/paddle/utils/code_gen/api_gen.py
浏览文件 @
66cd0bbb
...
...
@@ -111,7 +111,7 @@ class API:
def
gene_api_declaration
(
self
):
return
f
"""
P
D_DLL_DECL
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
'args_declare'
]
}
);
P
ADDLE_API
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
'args_declare'
]
}
);
"""
def
gene_kernel_select
(
self
,
input_names
,
attrs
,
kernel
):
...
...
@@ -312,7 +312,7 @@ PD_DLL_DECL {self.output} {self.api}({self.args['args_declare']});
def
gene_api_code
(
self
):
if
self
.
is_base_api
:
return
f
"""
P
D_DLL_DECL
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
"args_define"
]
}
) {{
P
ADDLE_API
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
"args_define"
]
}
) {{
{
self
.
gene_kernel_select
(
self
.
args
[
'inputs'
][
'names'
],
self
.
args
[
'attrs'
],
self
.
kernel
)
}
{
self
.
gene_kernel_context
(
self
.
args
[
'inputs'
][
'names'
],
self
.
args
[
'attrs'
],
self
.
infer_meta
,
self
.
kernel
[
'param'
])
}
...
...
@@ -323,7 +323,7 @@ PD_DLL_DECL {self.output} {self.api}({self.args["args_define"]}) {{
else
:
return
f
"""
P
D_DLL_DECL
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
"args_define"
]
}
) {{
P
ADDLE_API
{
self
.
output
}
{
self
.
api
}
(
{
self
.
args
[
"args_define"
]
}
) {{
return
{
self
.
invoke
}
;
}}
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录