Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
942ff89f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
942ff89f
编写于
8月 02, 2022
作者:
W
Weilong Wu
提交者:
GitHub
8月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Phi] polish and rename, pt* -> phi* (#44697)
* polish and rename, pt* -> phi* * fix code format
上级
d985b4b1
变更
10
展开全部
显示空白变更内容
内联
并排
Showing
10 changed file
with
844 addition
and
840 deletion
+844
-840
paddle/fluid/framework/new_executor/interpretercore.cc
paddle/fluid/framework/new_executor/interpretercore.cc
+3
-3
paddle/fluid/framework/new_executor/interpretercore_util.cc
paddle/fluid/framework/new_executor/interpretercore_util.cc
+12
-12
paddle/fluid/framework/new_executor/new_executor_defs.cc
paddle/fluid/framework/new_executor/new_executor_defs.cc
+3
-1
paddle/fluid/framework/new_executor/new_executor_defs.h
paddle/fluid/framework/new_executor/new_executor_defs.h
+1
-1
paddle/fluid/framework/operator.cc
paddle/fluid/framework/operator.cc
+101
-100
paddle/fluid/framework/operator.h
paddle/fluid/framework/operator.h
+4
-4
paddle/fluid/imperative/op_base.h
paddle/fluid/imperative/op_base.h
+1
-1
paddle/fluid/imperative/prepared_operator.cc
paddle/fluid/imperative/prepared_operator.cc
+27
-26
paddle/phi/capi/include/kernel_utils.h
paddle/phi/capi/include/kernel_utils.h
+249
-249
paddle/phi/core/kernel_registry.h
paddle/phi/core/kernel_registry.h
+443
-443
未找到文件。
paddle/fluid/framework/new_executor/interpretercore.cc
浏览文件 @
942ff89f
...
@@ -621,13 +621,13 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
...
@@ -621,13 +621,13 @@ void InterpreterCore::RunInstruction(const Instruction& instr_node) {
VLOG
(
4
)
<<
"Run phi kernel: "
<<
op
->
Type
();
VLOG
(
4
)
<<
"Run phi kernel: "
<<
op
->
Type
();
VLOG
(
4
)
<<
instr_node
.
InnerRuntimeContext
().
get
()
<<
" "
VLOG
(
4
)
<<
instr_node
.
InnerRuntimeContext
().
get
()
<<
" "
<<
&
instr_node
.
DeviceContext
();
<<
&
instr_node
.
DeviceContext
();
phi
::
KernelContext
p
t
_kernel_context
;
phi
::
KernelContext
p
hi
_kernel_context
;
op_with_kernel
->
BuildPhiKernelContext
(
op_with_kernel
->
BuildPhiKernelContext
(
*
instr_node
.
InnerRuntimeContext
().
get
(),
*
instr_node
.
InnerRuntimeContext
().
get
(),
const_cast
<
platform
::
DeviceContext
*>
(
&
instr_node
.
DeviceContext
()),
const_cast
<
platform
::
DeviceContext
*>
(
&
instr_node
.
DeviceContext
()),
&
p
t
_kernel_context
);
&
p
hi
_kernel_context
);
(
*
instr_node
.
PhiKernel
())(
&
p
t
_kernel_context
);
(
*
instr_node
.
PhiKernel
())(
&
p
hi
_kernel_context
);
}
else
{
}
else
{
instr_node
.
KernelFunc
()(
*
instr_node
.
InnerExecutionContext
().
get
());
instr_node
.
KernelFunc
()(
*
instr_node
.
InnerExecutionContext
().
get
());
...
...
paddle/fluid/framework/new_executor/interpretercore_util.cc
浏览文件 @
942ff89f
...
@@ -513,25 +513,25 @@ void build_op_func_list(const platform::Place& place,
...
@@ -513,25 +513,25 @@ void build_op_func_list(const platform::Place& place,
auto
run_phi_kernel
=
false
;
auto
run_phi_kernel
=
false
;
if
(
phi
::
KernelFactory
::
Instance
().
HasCompatiblePhiKernel
(
if
(
phi
::
KernelFactory
::
Instance
().
HasCompatiblePhiKernel
(
op_with_kernel
->
Type
()))
{
op_with_kernel
->
Type
()))
{
auto
p
t
_kernel_key
=
op_with_kernel
->
ChoosePhiKernel
(
exec_ctx
);
auto
p
hi
_kernel_key
=
op_with_kernel
->
ChoosePhiKernel
(
exec_ctx
);
auto
p
t
_kernel_name
=
op_with_kernel
->
PhiKernelSignature
()
->
name
;
auto
p
hi
_kernel_name
=
op_with_kernel
->
PhiKernelSignature
()
->
name
;
if
(
op_with_kernel
->
PhiKernel
()
->
IsValid
())
{
if
(
op_with_kernel
->
PhiKernel
()
->
IsValid
())
{
run_phi_kernel
=
true
;
run_phi_kernel
=
true
;
}
else
{
}
else
{
if
(
!
op_with_kernel
->
SupportsKernelType
(
expected_kernel_key
))
{
if
(
!
op_with_kernel
->
SupportsKernelType
(
expected_kernel_key
))
{
auto
p
t
_cpu_kernel_key
=
FallBackToCpu
(
auto
p
hi
_cpu_kernel_key
=
FallBackToCpu
(
expected_kernel_key
,
p
t
_kernel_key
,
*
op_with_kernel
);
expected_kernel_key
,
p
hi
_kernel_key
,
*
op_with_kernel
);
op_with_kernel
->
ResetPhiKernel
(
op_with_kernel
->
ResetPhiKernel
(
new
phi
::
Kernel
(
phi
::
KernelFactory
::
Instance
().
SelectKernel
(
new
phi
::
Kernel
(
phi
::
KernelFactory
::
Instance
().
SelectKernel
(
p
t_kernel_name
,
pt
_cpu_kernel_key
)));
p
hi_kernel_name
,
phi
_cpu_kernel_key
)));
if
(
op_with_kernel
->
PhiKernel
()
->
IsValid
())
{
if
(
op_with_kernel
->
PhiKernel
()
->
IsValid
())
{
VLOG
(
6
)
<<
"Static mode PrepareImpl - kernel name: "
VLOG
(
6
)
<<
"Static mode PrepareImpl - kernel name: "
<<
p
t
_kernel_name
<<
p
hi
_kernel_name
<<
" | kernel key: "
<<
p
t
_cpu_kernel_key
<<
" | kernel key: "
<<
p
hi
_cpu_kernel_key
<<
" | kernel: "
<<
*
(
op_with_kernel
->
PhiKernel
());
<<
" | kernel: "
<<
*
(
op_with_kernel
->
PhiKernel
());
op_with_kernel
->
ResetKernelType
(
new
OpKernelType
(
op_with_kernel
->
ResetKernelType
(
new
OpKernelType
(
TransPhiKernelKeyToOpKernelType
(
p
t
_cpu_kernel_key
)));
TransPhiKernelKeyToOpKernelType
(
p
hi
_cpu_kernel_key
)));
run_phi_kernel
=
true
;
run_phi_kernel
=
true
;
}
}
}
}
...
@@ -541,7 +541,7 @@ void build_op_func_list(const platform::Place& place,
...
@@ -541,7 +541,7 @@ void build_op_func_list(const platform::Place& place,
op_with_kernel
->
ChooseKernel
(
exec_ctx
);
op_with_kernel
->
ChooseKernel
(
exec_ctx
);
op_func_node
.
kernel_func_
=
*
op_with_kernel
->
kernel_func
();
op_func_node
.
kernel_func_
=
*
op_with_kernel
->
kernel_func
();
}
else
{
}
else
{
op_func_node
.
p
t
_kernel_
=
op_with_kernel
->
PhiKernel
();
op_func_node
.
p
hi
_kernel_
=
op_with_kernel
->
PhiKernel
();
}
}
auto
kernel_type
=
*
(
op_with_kernel
->
kernel_type
());
auto
kernel_type
=
*
(
op_with_kernel
->
kernel_type
());
if
(
kernel_type
.
place_
!=
dev_ctx
->
GetPlace
())
{
if
(
kernel_type
.
place_
!=
dev_ctx
->
GetPlace
())
{
...
@@ -583,10 +583,10 @@ void build_op_func_list(const platform::Place& place,
...
@@ -583,10 +583,10 @@ void build_op_func_list(const platform::Place& place,
// step 5. run kernel
// step 5. run kernel
if
(
run_phi_kernel
)
{
if
(
run_phi_kernel
)
{
phi
::
KernelContext
p
t
_kernel_context
;
phi
::
KernelContext
p
hi
_kernel_context
;
op_with_kernel
->
BuildPhiKernelContext
(
op_with_kernel
->
BuildPhiKernelContext
(
runtime_context
,
dev_ctx
,
&
p
t
_kernel_context
);
runtime_context
,
dev_ctx
,
&
p
hi
_kernel_context
);
(
*
op_func_node
.
p
t_kernel_
)(
&
pt
_kernel_context
);
(
*
op_func_node
.
p
hi_kernel_
)(
&
phi
_kernel_context
);
}
else
{
}
else
{
// the place of exec_ctx maybe has changed.
// the place of exec_ctx maybe has changed.
op_func_node
.
kernel_func_
(
ExecutionContext
(
op_func_node
.
kernel_func_
(
ExecutionContext
(
...
...
paddle/fluid/framework/new_executor/new_executor_defs.cc
浏览文件 @
942ff89f
...
@@ -705,7 +705,9 @@ OpKernelComputeFunc Instruction::KernelFunc() const {
...
@@ -705,7 +705,9 @@ OpKernelComputeFunc Instruction::KernelFunc() const {
return
op_func_node_
.
kernel_func_
;
return
op_func_node_
.
kernel_func_
;
}
}
phi
::
Kernel
*
Instruction
::
PhiKernel
()
const
{
return
op_func_node_
.
pt_kernel_
;
}
phi
::
Kernel
*
Instruction
::
PhiKernel
()
const
{
return
op_func_node_
.
phi_kernel_
;
}
OpFuncType
Instruction
::
KernelType
()
const
{
return
op_func_node_
.
type_
;
}
OpFuncType
Instruction
::
KernelType
()
const
{
return
op_func_node_
.
type_
;
}
...
...
paddle/fluid/framework/new_executor/new_executor_defs.h
浏览文件 @
942ff89f
...
@@ -283,7 +283,7 @@ struct OpFuncNode {
...
@@ -283,7 +283,7 @@ struct OpFuncNode {
platform
::
DeviceContext
*
dev_ctx_
;
// not owned
platform
::
DeviceContext
*
dev_ctx_
;
// not owned
// fit for phi kernel
// fit for phi kernel
phi
::
Kernel
*
p
t
_kernel_
{
nullptr
};
// not owned
phi
::
Kernel
*
p
hi
_kernel_
{
nullptr
};
// not owned
OpFuncType
type_
;
OpFuncType
type_
;
};
};
...
...
paddle/fluid/framework/operator.cc
浏览文件 @
942ff89f
此差异已折叠。
点击以展开。
paddle/fluid/framework/operator.h
浏览文件 @
942ff89f
...
@@ -652,16 +652,16 @@ class OperatorWithKernel : public OperatorBase {
...
@@ -652,16 +652,16 @@ class OperatorWithKernel : public OperatorBase {
void
BuildPhiKernelContext
(
const
RuntimeContext
&
ctx
,
void
BuildPhiKernelContext
(
const
RuntimeContext
&
ctx
,
platform
::
DeviceContext
*
dev_ctx
,
platform
::
DeviceContext
*
dev_ctx
,
phi
::
KernelContext
*
p
t
_kernel_context
)
const
;
phi
::
KernelContext
*
p
hi
_kernel_context
)
const
;
phi
::
KernelSignature
*
PhiKernelSignature
()
const
{
phi
::
KernelSignature
*
PhiKernelSignature
()
const
{
return
kernel_signature_
.
get
();
return
kernel_signature_
.
get
();
}
}
phi
::
Kernel
*
PhiKernel
()
const
{
return
p
t
_kernel_
.
get
();
}
phi
::
Kernel
*
PhiKernel
()
const
{
return
p
hi
_kernel_
.
get
();
}
void
ResetPhiKernel
(
phi
::
Kernel
*
kernel
)
const
{
void
ResetPhiKernel
(
phi
::
Kernel
*
kernel
)
const
{
return
p
t
_kernel_
.
reset
(
kernel
);
return
p
hi
_kernel_
.
reset
(
kernel
);
}
}
const
OpKernelType
*
kernel_type
()
const
{
return
kernel_type_
.
get
();
}
const
OpKernelType
*
kernel_type
()
const
{
return
kernel_type_
.
get
();
}
...
@@ -730,7 +730,7 @@ class OperatorWithKernel : public OperatorBase {
...
@@ -730,7 +730,7 @@ class OperatorWithKernel : public OperatorBase {
mutable
bool
run_phi_kernel_
=
false
;
mutable
bool
run_phi_kernel_
=
false
;
mutable
bool
run_kp_kernel
=
false
;
mutable
bool
run_kp_kernel
=
false
;
mutable
std
::
unique_ptr
<
phi
::
KernelSignature
>
kernel_signature_
;
mutable
std
::
unique_ptr
<
phi
::
KernelSignature
>
kernel_signature_
;
mutable
std
::
unique_ptr
<
phi
::
Kernel
>
p
t
_kernel_
;
mutable
std
::
unique_ptr
<
phi
::
Kernel
>
p
hi
_kernel_
;
mutable
std
::
unique_ptr
<
phi
::
ArgumentMappingFn
>
arg_map_fn_
;
mutable
std
::
unique_ptr
<
phi
::
ArgumentMappingFn
>
arg_map_fn_
;
struct
CacheImpl
;
struct
CacheImpl
;
...
...
paddle/fluid/imperative/op_base.h
浏览文件 @
942ff89f
...
@@ -227,7 +227,7 @@ class OpBase {
...
@@ -227,7 +227,7 @@ class OpBase {
size_t
id_
{
-
1UL
};
size_t
id_
{
-
1UL
};
// In order to reduce the compatibility phase
// In order to reduce the compatibility phase
// performance overhead, temporarily cache KernelContext
// performance overhead, temporarily cache KernelContext
static
phi
::
KernelContext
p
t
_kernel_context_
;
static
phi
::
KernelContext
p
hi
_kernel_context_
;
std
::
vector
<
std
::
shared_ptr
<
std
::
function
<
void
()
>>>
void_function_post_hooks_
;
std
::
vector
<
std
::
shared_ptr
<
std
::
function
<
void
()
>>>
void_function_post_hooks_
;
};
};
...
...
paddle/fluid/imperative/prepared_operator.cc
浏览文件 @
942ff89f
...
@@ -183,8 +183,8 @@ PreparedOp PrepareImpl(
...
@@ -183,8 +183,8 @@ PreparedOp PrepareImpl(
const
phi
::
KernelSignature
*
default_kernel_signature
=
nullptr
;
const
phi
::
KernelSignature
*
default_kernel_signature
=
nullptr
;
phi
::
KernelSignature
kernel_signature
;
phi
::
KernelSignature
kernel_signature
;
phi
::
KernelKey
p
t
_kernel_key
;
phi
::
KernelKey
p
hi
_kernel_key
;
std
::
string
p
t
_kernel_name
;
std
::
string
p
hi
_kernel_name
;
#if defined(PADDLE_WITH_XPU)
#if defined(PADDLE_WITH_XPU)
bool
is_xpu_unsupport
=
bool
is_xpu_unsupport
=
paddle
::
platform
::
is_xpu_place
(
expected_kernel_key
.
place_
)
&&
paddle
::
platform
::
is_xpu_place
(
expected_kernel_key
.
place_
)
&&
...
@@ -213,7 +213,7 @@ PreparedOp PrepareImpl(
...
@@ -213,7 +213,7 @@ PreparedOp PrepareImpl(
if
(
has_phi_kernel
)
{
if
(
has_phi_kernel
)
{
VLOG
(
6
)
<<
kernel_signature
;
VLOG
(
6
)
<<
kernel_signature
;
p
t
_kernel_name
=
kernel_signature
.
name
;
p
hi
_kernel_name
=
kernel_signature
.
name
;
// NOTE(Liu-xiandong): The register kernel used KP have library_type[KP],
// NOTE(Liu-xiandong): The register kernel used KP have library_type[KP],
// But the default library_type is Plain, so we need to modify the
// But the default library_type is Plain, so we need to modify the
// library_type here, otherwise it can't work.
// library_type here, otherwise it can't work.
...
@@ -236,34 +236,35 @@ PreparedOp PrepareImpl(
...
@@ -236,34 +236,35 @@ PreparedOp PrepareImpl(
auto
expected_kernel_key_library_type
=
auto
expected_kernel_key_library_type
=
expected_kernel_key
.
library_type_
;
expected_kernel_key
.
library_type_
;
expected_kernel_key
.
library_type_
=
paddle
::
framework
::
LibraryType
::
kKP
;
expected_kernel_key
.
library_type_
=
paddle
::
framework
::
LibraryType
::
kKP
;
VLOG
(
3
)
<<
"modifing XPU KP kernel: "
<<
p
t
_kernel_name
VLOG
(
3
)
<<
"modifing XPU KP kernel: "
<<
p
hi
_kernel_name
<<
", using_kernel_key:"
<<
expected_kernel_key
;
<<
", using_kernel_key:"
<<
expected_kernel_key
;
phi
::
KernelKey
try_p
t
_kernel_key
=
phi
::
KernelKey
try_p
hi
_kernel_key
=
TransOpKernelTypeToPhiKernelKey
(
expected_kernel_key
);
TransOpKernelTypeToPhiKernelKey
(
expected_kernel_key
);
if
(
!
phi_kernel_factory
.
HasKernel
(
pt_kernel_name
,
try_pt_kernel_key
))
{
if
(
!
phi_kernel_factory
.
HasKernel
(
phi_kernel_name
,
try_phi_kernel_key
))
{
expected_kernel_key
.
library_type_
=
expected_kernel_key_library_type
;
expected_kernel_key
.
library_type_
=
expected_kernel_key_library_type
;
VLOG
(
3
)
<<
"modify XPU KP kernel: "
<<
p
t
_kernel_name
VLOG
(
3
)
<<
"modify XPU KP kernel: "
<<
p
hi
_kernel_name
<<
" in dynamic graph is failed "
<<
expected_kernel_key
;
<<
" in dynamic graph is failed "
<<
expected_kernel_key
;
}
else
{
}
else
{
VLOG
(
3
)
<<
"modify XPU KP kernel: "
<<
p
t
_kernel_name
VLOG
(
3
)
<<
"modify XPU KP kernel: "
<<
p
hi
_kernel_name
<<
" in dynamic graph is succeed "
<<
expected_kernel_key
;
<<
" in dynamic graph is succeed "
<<
expected_kernel_key
;
}
}
}
}
}
}
#endif
#endif
p
t
_kernel_key
=
TransOpKernelTypeToPhiKernelKey
(
expected_kernel_key
);
p
hi
_kernel_key
=
TransOpKernelTypeToPhiKernelKey
(
expected_kernel_key
);
auto
&
phi_kernel
=
auto
&
phi_kernel
=
phi_kernel_factory
.
SelectKernel
(
p
t_kernel_name
,
pt
_kernel_key
);
phi_kernel_factory
.
SelectKernel
(
p
hi_kernel_name
,
phi
_kernel_key
);
if
(
phi_kernel
.
IsValid
()
if
(
phi_kernel
.
IsValid
()
#if defined(PADDLE_WITH_XPU) && !defined(PADDLE_WITH_XPU_KP)
#if defined(PADDLE_WITH_XPU) && !defined(PADDLE_WITH_XPU_KP)
&&
!
is_xpu_unsupport
&&
!
is_xpu_unsupport
#endif
#endif
)
{
)
{
VLOG
(
6
)
<<
"Dynamic mode PrepareImpl - kernel name: "
<<
p
t
_kernel_name
VLOG
(
6
)
<<
"Dynamic mode PrepareImpl - kernel name: "
<<
p
hi
_kernel_name
<<
" | kernel key: "
<<
p
t
_kernel_key
<<
" | kernel key: "
<<
p
hi
_kernel_key
<<
" | kernel: "
<<
phi_kernel
;
<<
" | kernel: "
<<
phi_kernel
;
if
(
expected_kernel_key
.
place_
!=
place
)
{
if
(
expected_kernel_key
.
place_
!=
place
)
{
...
@@ -279,7 +280,7 @@ PreparedOp PrepareImpl(
...
@@ -279,7 +280,7 @@ PreparedOp PrepareImpl(
phi_kernel
,
phi_kernel
,
dev_ctx
);
dev_ctx
);
}
else
{
}
else
{
VLOG
(
6
)
<<
"Dynamic mode ChoosePhiKernel - kernel `"
<<
p
t
_kernel_name
VLOG
(
6
)
<<
"Dynamic mode ChoosePhiKernel - kernel `"
<<
p
hi
_kernel_name
<<
"` not found."
;
<<
"` not found."
;
}
}
}
}
...
@@ -316,23 +317,23 @@ PreparedOp PrepareImpl(
...
@@ -316,23 +317,23 @@ PreparedOp PrepareImpl(
#endif
#endif
)
{
)
{
if
(
has_phi_kernel
)
{
if
(
has_phi_kernel
)
{
auto
p
t
_cpu_kernel_key
=
auto
p
hi
_cpu_kernel_key
=
FallBackToCpu
(
expected_kernel_key
,
p
t
_kernel_key
,
op
);
FallBackToCpu
(
expected_kernel_key
,
p
hi
_kernel_key
,
op
);
auto
&
p
t
_cpu_kernel
=
auto
&
p
hi
_cpu_kernel
=
phi_kernel_factory
.
SelectKernel
(
p
t_kernel_name
,
pt
_cpu_kernel_key
);
phi_kernel_factory
.
SelectKernel
(
p
hi_kernel_name
,
phi
_cpu_kernel_key
);
if
(
p
t
_cpu_kernel
.
IsValid
())
{
if
(
p
hi
_cpu_kernel
.
IsValid
())
{
VLOG
(
6
)
<<
"Dynamic mode PrepareImpl - kernel name: "
<<
p
t
_kernel_name
VLOG
(
6
)
<<
"Dynamic mode PrepareImpl - kernel name: "
<<
p
hi
_kernel_name
<<
" | kernel key: "
<<
p
t
_cpu_kernel_key
<<
" | kernel key: "
<<
p
hi
_cpu_kernel_key
<<
" | kernel: "
<<
p
t
_cpu_kernel
;
<<
" | kernel: "
<<
p
hi
_cpu_kernel
;
auto
*
cpu_ctx
=
pool
.
Get
(
paddle
::
platform
::
CPUPlace
());
auto
*
cpu_ctx
=
pool
.
Get
(
paddle
::
platform
::
CPUPlace
());
return
PreparedOp
(
return
PreparedOp
(
op
,
op
,
empty_ctx
,
empty_ctx
,
framework
::
TransPhiKernelKeyToOpKernelType
(
p
t
_cpu_kernel_key
),
framework
::
TransPhiKernelKeyToOpKernelType
(
p
hi
_cpu_kernel_key
),
arg_map_fn
,
arg_map_fn
,
default_kernel_signature
,
default_kernel_signature
,
std
::
move
(
kernel_signature
),
std
::
move
(
kernel_signature
),
p
t
_cpu_kernel
,
p
hi
_cpu_kernel
,
cpu_ctx
);
cpu_ctx
);
}
}
}
}
...
@@ -610,7 +611,7 @@ static void PreparedOpRunPtImpl(
...
@@ -610,7 +611,7 @@ static void PreparedOpRunPtImpl(
PreparePhiData
<
VarType
>
(
phi_kernel
,
kernel_signature
,
ins
);
PreparePhiData
<
VarType
>
(
phi_kernel
,
kernel_signature
,
ins
);
phi
::
KernelContext
p
t
_kernel_context
;
phi
::
KernelContext
p
hi
_kernel_context
;
BuildDygraphPhiKernelContext
<
VarType
>
(
kernel_signature
,
BuildDygraphPhiKernelContext
<
VarType
>
(
kernel_signature
,
phi_kernel
,
phi_kernel
,
ins
,
ins
,
...
@@ -618,9 +619,9 @@ static void PreparedOpRunPtImpl(
...
@@ -618,9 +619,9 @@ static void PreparedOpRunPtImpl(
attrs
,
attrs
,
default_attrs
,
default_attrs
,
dev_ctx
,
dev_ctx
,
&
p
t
_kernel_context
);
&
p
hi
_kernel_context
);
phi_kernel
(
&
p
t
_kernel_context
);
phi_kernel
(
&
p
hi
_kernel_context
);
}
}
if
(
FLAGS_check_nan_inf
)
{
if
(
FLAGS_check_nan_inf
)
{
...
...
paddle/phi/capi/include/kernel_utils.h
浏览文件 @
942ff89f
...
@@ -138,7 +138,7 @@ namespace capi {
...
@@ -138,7 +138,7 @@ namespace capi {
meta_kernel_fn, \
meta_kernel_fn, \
cpp_dtype) \
cpp_dtype) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
int TouchCustomKernelSymbolFor_##kernel_name##_##backend##_##layout() { \
int TouchCustomKernelSymbolFor_##kernel_name##_##backend##_##layout() { \
return 0; \
return 0; \
}
}
...
@@ -152,7 +152,7 @@ namespace capi {
...
@@ -152,7 +152,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_1(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_1(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -171,7 +171,7 @@ namespace capi {
...
@@ -171,7 +171,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_2(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_2(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -190,7 +190,7 @@ namespace capi {
...
@@ -190,7 +190,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_3(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_3(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -209,7 +209,7 @@ namespace capi {
...
@@ -209,7 +209,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_4(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_4(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -228,7 +228,7 @@ namespace capi {
...
@@ -228,7 +228,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_5(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_5(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -247,7 +247,7 @@ namespace capi {
...
@@ -247,7 +247,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_6(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_6(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -266,7 +266,7 @@ namespace capi {
...
@@ -266,7 +266,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_7(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_7(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -285,7 +285,7 @@ namespace capi {
...
@@ -285,7 +285,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_8(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_8(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -304,7 +304,7 @@ namespace capi {
...
@@ -304,7 +304,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_9(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_9(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -323,7 +323,7 @@ namespace capi {
...
@@ -323,7 +323,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_10(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_10(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -342,7 +342,7 @@ namespace capi {
...
@@ -342,7 +342,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_11(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_11(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -361,7 +361,7 @@ namespace capi {
...
@@ -361,7 +361,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_12(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_12(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -380,7 +380,7 @@ namespace capi {
...
@@ -380,7 +380,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_13(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_13(registrar_class, \
kernel_name, \
kernel_name, \
...
@@ -399,7 +399,7 @@ namespace capi {
...
@@ -399,7 +399,7 @@ namespace capi {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
static const registrar_class<cpp_dtype> PD_CUSTOM_PHI_KERNEL_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id); \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
PD_CUSTOM_PHI_KERNEL_EXPAND( \
_PD_BUILD_KERNEL_REGISTRAR_INIT_14(registrar_class, \
_PD_BUILD_KERNEL_REGISTRAR_INIT_14(registrar_class, \
kernel_name, \
kernel_name, \
...
...
paddle/phi/core/kernel_registry.h
浏览文件 @
942ff89f
...
@@ -563,7 +563,7 @@ struct KernelRegistrar {
...
@@ -563,7 +563,7 @@ struct KernelRegistrar {
meta_kernel_fn, \
meta_kernel_fn, \
cpp_dtype) \
cpp_dtype) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -586,7 +586,7 @@ struct KernelRegistrar {
...
@@ -586,7 +586,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -617,7 +617,7 @@ struct KernelRegistrar {
...
@@ -617,7 +617,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -648,7 +648,7 @@ struct KernelRegistrar {
...
@@ -648,7 +648,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -679,7 +679,7 @@ struct KernelRegistrar {
...
@@ -679,7 +679,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -710,7 +710,7 @@ struct KernelRegistrar {
...
@@ -710,7 +710,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -741,7 +741,7 @@ struct KernelRegistrar {
...
@@ -741,7 +741,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -772,7 +772,7 @@ struct KernelRegistrar {
...
@@ -772,7 +772,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -803,7 +803,7 @@ struct KernelRegistrar {
...
@@ -803,7 +803,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -834,7 +834,7 @@ struct KernelRegistrar {
...
@@ -834,7 +834,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -865,7 +865,7 @@ struct KernelRegistrar {
...
@@ -865,7 +865,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -896,7 +896,7 @@ struct KernelRegistrar {
...
@@ -896,7 +896,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -927,7 +927,7 @@ struct KernelRegistrar {
...
@@ -927,7 +927,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -958,7 +958,7 @@ struct KernelRegistrar {
...
@@ -958,7 +958,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -989,7 +989,7 @@ struct KernelRegistrar {
...
@@ -989,7 +989,7 @@ struct KernelRegistrar {
cpp_dtype, \
cpp_dtype, \
...) \
...) \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
static const ::phi::KernelRegistrar PD_CONCATENATE( \
__reg_p
t
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
__reg_p
hi
_kernel_##kernel_name##_##backend##_##layout##_, registrar_id)( \
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -1035,7 +1035,7 @@ struct KernelRegistrar {
...
@@ -1035,7 +1035,7 @@ struct KernelRegistrar {
static void __PD_KERNEL_args_def_FN_##kernel_name##_##backend##_##layout( \
static void __PD_KERNEL_args_def_FN_##kernel_name##_##backend##_##layout( \
const ::phi::KernelKey& kernel_key, ::phi::Kernel* kernel); \
const ::phi::KernelKey& kernel_key, ::phi::Kernel* kernel); \
static const ::phi::KernelRegistrar \
static const ::phi::KernelRegistrar \
__reg_p
t_kernel_##kernel_name##_##backend##_##layout(
\
__reg_p
hi_kernel_##kernel_name##_##backend##_##layout(
\
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
@@ -1055,7 +1055,7 @@ struct KernelRegistrar {
...
@@ -1055,7 +1055,7 @@ struct KernelRegistrar {
static void __PD_KERNEL_args_def_FN_##kernel_name##_##backend##_##layout( \
static void __PD_KERNEL_args_def_FN_##kernel_name##_##backend##_##layout( \
const ::phi::KernelKey& kernel_key, ::phi::Kernel* kernel); \
const ::phi::KernelKey& kernel_key, ::phi::Kernel* kernel); \
static const ::phi::KernelRegistrar \
static const ::phi::KernelRegistrar \
__reg_p
t_kernel_##kernel_name##_##backend##_##layout(
\
__reg_p
hi_kernel_##kernel_name##_##backend##_##layout(
\
reg_type, \
reg_type, \
#kernel_name, \
#kernel_name, \
#backend, \
#backend, \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录