Skip to content

[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

Closed

Conversation

YuanRisheng
Copy link
Contributor

@YuanRisheng YuanRisheng commented Dec 16, 2021

PR types

Others

PR changes

Others

Describe

将elementwise kernel(elementwise_add/sub/mul/div)按照新设计的目录标准进行拆分放置。Pten新目录kernel放置原则参照:#37916

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

for (int i = 0; i < Arity; i++) {
ins_data[i] = ins[i]->data<InT>();
}
#ifdef PADDLE_WITH_XPU2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要确认下,PADDLE_WITH_XPU2表示这个函数也可以在XPU使用吗?如果是这样的话,这里的函数就属于公共函数了

Copy link
Contributor Author

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) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个宏建议分别放到对应的cc或cu中了,其他地方不应该使用了,新目录结构下,这样更好一些

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include头文件,而不是using context

Copy link
Contributor Author

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的CPUContext是不是需要include pten最新的Context头文件?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,thankyou very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants