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

Add support of variadic functions as call exprs in Forward mode #1246

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kchristin22
Copy link
Collaborator

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

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
@kchristin22 kchristin22 self-assigned this Feb 19, 2025
Copy link
Contributor

@github-actions github-actions bot left a 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();
Copy link
Contributor

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();
       ^

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.67%. Comparing base (c99b0c4) to head (29e2865).
Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1246   +/-   ##
=======================================
  Coverage   94.66%   94.67%           
=======================================
  Files          51       51           
  Lines        8903     8918   +15     
=======================================
+ Hits         8428     8443   +15     
  Misses        475      475           
Files with missing lines Coverage Δ
lib/Differentiator/BaseForwardModeVisitor.cpp 98.71% <100.00%> (+0.01%) ⬆️

... and 5 files with indirect coverage changes

Files with missing lines Coverage Δ
lib/Differentiator/BaseForwardModeVisitor.cpp 98.71% <100.00%> (+0.01%) ⬆️

... 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'
Copy link
Owner

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 ...

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