-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add support of variadic functions as call exprs in Forward mode #1246
base: master
Are you sure you want to change the base?
Conversation
Changes applied: * Use Call arg instead of Function param to store differentiation call's args * Create Unique Identifier for each param expanded from the pack of a variadic function * Add test
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
@@ -1104,6 +1121,7 @@ StmtDiff BaseForwardModeVisitor::VisitCallExpr(const CallExpr* CE) { | |||
skipFirstArg = true; | |||
|
|||
// For f(g(x)) = f'(x) * g'(x) | |||
std::size_t numParams = FD->getNumParams(); |
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: no header providing "std::size_t" is directly included [misc-include-cleaner]
std::size_t numParams = FD->getNumParams();
^
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1246 +/- ##
=======================================
Coverage 94.66% 94.67%
=======================================
Files 51 51
Lines 8903 8918 +15
=======================================
+ Hits 8428 8443 +15
Misses 475 475
... and 5 files with indirect coverage changes
|
@@ -3,20 +3,23 @@ | |||
|
|||
#include "clad/Differentiator/Differentiator.h" | |||
|
|||
#include "../TestUtils.h" | |||
// CHECK: warning: function 'printf' was not differentiated because clad failed to differentiate it and no suitable overload was found in namespace 'custom_derivatives' |
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 should add -Xclang -verify
and use the syntax of // expected-warning ...
Changes applied: