-
Notifications
You must be signed in to change notification settings - Fork 123
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
Operator overload in reverse mode #619
Operator overload in reverse mode #619
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #619 +/- ##
==========================================
+ Coverage 94.05% 94.09% +0.04%
==========================================
Files 43 43
Lines 6237 6269 +32
==========================================
+ Hits 5866 5899 +33
+ Misses 371 370 -1
|
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 50. Check the log or trigger a new build to see more.
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 40. Check the log or trigger a new build to see more.
b18b297
to
34ef818
Compare
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 12. Check the log or trigger a new build to see more.
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.
clang-tidy made some suggestions
54b7176
to
f45e87a
Compare
clang-tidy review says "All clean, LGTM! 👍" |
75508b2
to
dd0bb36
Compare
clang-tidy review says "All clean, LGTM! 👍" |
dd0bb36
to
9c5aab1
Compare
clang-tidy review says "All clean, LGTM! 👍" |
9c5aab1
to
514ac7c
Compare
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.
clang-tidy made some suggestions
514ac7c
to
92d306b
Compare
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.
clang-tidy made some suggestions
@@ -1597,8 +1603,11 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, | |||
|
|||
/// Add base derivative expression in the derived call output args list if | |||
/// `CE` is a call to an instance member function. | |||
if (auto MCE = dyn_cast<CXXMemberCallExpr>(CE)) { | |||
if (auto MCE = dyn_cast<CXXMemberCallExpr>(CE)) |
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.
warning: 'auto MCE' can be declared as 'const auto *MCE' [llvm-qualified-auto]
if (auto MCE = dyn_cast<CXXMemberCallExpr>(CE)) | |
if (const auto *MCE = dyn_cast<CXXMemberCallExpr>(CE)) |
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.
We need more tests.
- Member operator overloads -- operator overloads that are defined inside the class.
- Operator overload that does not return a reference type.
- Unary operator overload.
For 1, our tests already cover the case. if (!FD->getReturnType()->isVoidType()) {
assert((pullback && !FD->getReturnType()->isVoidType()) &&
"Call to function returning non-void type with no dfdx() is not "
"supported!");
} For 3, I have added tests for unary op. |
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.
clang-tidy made some suggestions
66eb42b
to
985097e
Compare
Why does the restriction that you mentioned prevent non-reference return types? Also, why do you think it only affects non-reference return type operator overloads, but not non-reference return type ordinary member functions? |
985097e
to
578b8fc
Compare
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.
clang-tidy made some suggestions
@@ -1749,7 +1762,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, | |||
// derive the called function. | |||
DiffRequest pullbackRequest{}; | |||
pullbackRequest.Function = FD; | |||
pullbackRequest.BaseFunctionName = FD->getNameAsString(); | |||
pullbackRequest.BaseFunctionName = |
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.
warning: implicit conversion 'clang::Expr *' -> bool [readability-implicit-bool-conversion]
pullbackRequest.BaseFunctionName = | |
pullbackCallArgs, ArgDeclStmts, dfdx() != nullptr); |
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.
LGTM!
Add support for operator overload in reverse mode