-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[PTen]Move elementwise kernel to new directory #38221
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
Conversation
Thanks for your contribution! |
for (int i = 0; i < Arity; i++) { | ||
ins_data[i] = ins[i]->data<InT>(); | ||
} | ||
#ifdef PADDLE_WITH_XPU2 |
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.
需要确认下,PADDLE_WITH_XPU2表示这个函数也可以在XPU使用吗?如果是这样的话,这里的函数就属于公共函数了
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.
这个已和相关同学沟通,目前还未扩展到xpu,后边会一起挪到公共函数里
|
||
} // namespace pten | ||
|
||
#define DEFINE_CPU_ELEMENTWISE_OP(name) \ |
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.
这两个宏建议分别放到对应的cc或cu中了,其他地方不应该使用了,新目录结构下,这样更好一些
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.
done,thankyou very much
|
||
using DDim = paddle::framework::DDim; | ||
using CPUContext = paddle::platform::CPUDeviceContext; |
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.
include头文件,而不是using context
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.
done,thankyou very much
@@ -131,6 +131,7 @@ class MidWiseTransformIterator<T, CPUContext> | |||
}; | |||
|
|||
#if defined(__NVCC__) || defined(__HIPCC__) | |||
using CUDAContext = paddle::platform::CUDADeviceContext; |
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.
同上
|
||
using DDim = paddle::framework::DDim; | ||
using CPUContext = paddle::platform::CPUDeviceContext; |
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.
这里的CPUContext
是不是需要include pten最新的Context头文件?
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.
done,thankyou very much
PR types
Others
PR changes
Others
Describe
将elementwise kernel(elementwise_add/sub/mul/div)按照新设计的目录标准进行拆分放置。Pten新目录kernel放置原则参照:#37916