Skip to content
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] move bernoulli kernel to pten #39590

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Feb 15, 2022

PR types

Function optimization

PR changes

OPs

Describe

[pten] move bernoulli kernel to pten

@paddle-bot-old
Copy link

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

namespace pten {

template <typename T>
inline HOSTDEVICE T BernoulliFunctor(T p, T rand) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个函数貌似只能在cpu下用,可以放到cc里面吗?虽然有HOSTDEVICE的声明,但里面用的PADDLE_ENFORCE_LE在GPU下编译会失败的,这个HOSTDEVICE应该也不需要?

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

@zhiqiu zhiqiu merged commit f86073c into PaddlePaddle:develop Feb 17, 2022
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.

2 participants