-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PTen] Refine Kernel Registrar Writing #37977
[PTen] Refine Kernel Registrar Writing #37977
Conversation
… pten/auto_generate_kernel_declare
Thanks for your contribution! |
* of the kernel, this registration macro will not do automatic template | ||
* instantiation. | ||
*/ | ||
#define PT_REGISTER_SINGLE_KERNEL( \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PT_REGISTER_SINGLE_KERNEL是不是没有使用?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,但是我们需要保留这样一个基础接口,这个是使用一个函数指针进行标准注册的情况,在无法使用PT_REGISTER_KERNEL注册的时候,即使重复写很多遍,也要能注册一个kernel
@@ -130,12 +130,9 @@ void Cast(const CPUContext& dev_ctx, | |||
|
|||
} // namespace pten | |||
|
|||
// TODO(chenweihang): replace by better impl | |||
PT_REGISTER_MODULE(ManipulationCPU); | |||
|
|||
// TODO(yuanrisheng): "flatten_contiguous_range" is compatible with old kernel | |||
// architecture, kernel_name should be "flatten". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个todo可以删掉了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx,下一个PR移除
PR types
Function optimization
PR changes
Others
Describe
[PTen] Refine Kernel Registrar Writing
.overload_name
机制去除的话,kernel注册写法改回和原fluid注册一致的写法,即直接使用名字,而不是字符串,在编译自动化上更易实现,因此进行了全局修改