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

Fix DifferentiateVarDecl for constructors in reverse mode #630

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

vaithak
Copy link
Collaborator

@vaithak vaithak commented Sep 21, 2023

This fixes the error in #627 related to invalid operands in a binary expression.

A very minimal example that was failing earlier:

class Experiment {
   
public:
    Experiment(int n=0){}
};

double f(double x, int n) {
  Experiment E(n);
  return 0.0; 
}

int main() {
  auto f_dx = clad::gradient(f, "x");
}

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #630 (3acc860) into master (71dd694) will increase coverage by 0.00%.
Report is 1 commits behind head on master.
The diff coverage is 88.88%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #630   +/-   ##
=======================================
  Coverage   94.04%   94.05%           
=======================================
  Files          43       43           
  Lines        6230     6236    +6     
=======================================
+ Hits         5859     5865    +6     
  Misses        371      371           
Files Changed Coverage Δ
lib/Differentiator/StmtClone.cpp 51.35% <0.00%> (ø)
tools/ClangBackendPlugin.cpp 66.66% <ø> (ø)
include/clad/Differentiator/Compatibility.h 91.04% <100.00%> (+0.27%) ⬆️
include/clad/Differentiator/VisitorBase.h 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.77% <100.00%> (+<0.01%) ⬆️
Files Changed Coverage Δ
lib/Differentiator/StmtClone.cpp 51.35% <0.00%> (ø)
tools/ClangBackendPlugin.cpp 66.66% <ø> (ø)
include/clad/Differentiator/Compatibility.h 91.04% <100.00%> (+0.27%) ⬆️
include/clad/Differentiator/VisitorBase.h 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.77% <100.00%> (+<0.01%) ⬆️

Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev
Copy link
Owner

The codecov report seems invalid. Let’s merge it.

@vgvassilev vgvassilev merged commit 1bdc579 into vgvassilev:master Sep 21, 2023
@vaithak vaithak deleted the constructor-fix branch September 22, 2023 07:15
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