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

[part 3]change type of function args #38887

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

zhangting2020
Copy link
Contributor

PR types

Function optimization

PR changes

OPs

Describe

#38859 支持不同输入类型的elementwise op,需要修改计算函数的参数为值传递

@paddle-bot-old
Copy link

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

@@ -35,7 +35,7 @@ LOGICAL_BINARY_FUNCTOR(CudaXorFunctor, ^)
template <typename T>
struct CudaNotFunctor {
using ELEMENT_TYPE = T;
HOSTDEVICE bool operator()(const T* args) const { return !args[0]; }
HOSTDEVICE bool operator()(const T a) const { return !a; }
};
Copy link
Contributor

Choose a reason for hiding this comment

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

.cu里面的Functor可以删除,直接复用.h里面的

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. 已统一

Copy link
Contributor

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM

@Xreki Xreki merged commit 0efcae8 into PaddlePaddle:develop Jan 12, 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