Skip to content

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

2 participants