-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for call expressions in vector forward mode AD
- Loading branch information
Showing
15 changed files
with
476 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//--------------------------------------------------------------------*- C++ -*- | ||
// clad - the C++ Clang-based Automatic Differentiator | ||
// version: $Id: ClangPlugin.cpp 7 2013-06-01 22:48:03Z [email protected] $ | ||
// author: Vassil Vassilev <vvasilev-at-cern.ch> | ||
//------------------------------------------------------------------------------ | ||
|
||
#ifndef CLAD_FORWARD_MODE_VISITOR_H | ||
#define CLAD_FORWARD_MODE_VISITOR_H | ||
|
||
#include "BaseForwardModeVisitor.h" | ||
|
||
namespace clad { | ||
/// A visitor for processing the function code in forward mode. | ||
/// Used to compute derivatives by clad::differentiate. | ||
class PushForwardModeVisitor : virtual public BaseForwardModeVisitor { | ||
|
||
public: | ||
PushForwardModeVisitor(DerivativeBuilder& builder); | ||
~PushForwardModeVisitor() override; | ||
|
||
StmtDiff VisitReturnStmt(const clang::ReturnStmt* RS) override; | ||
}; | ||
} // end namespace clad | ||
|
||
#endif // CLAD_FORWARD_MODE_VISITOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
include/clad/Differentiator/VectorPushForwardModeVisitor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef CLAD_DIFFERENTIATOR_VECTORPUSHFORWARDMODEVISITOR_H | ||
#define CLAD_DIFFERENTIATOR_VECTORPUSHFORWARDMODEVISITOR_H | ||
|
||
#include "PushForwardModeVisitor.h" | ||
#include "VectorForwardModeVisitor.h" | ||
|
||
namespace clad { | ||
class VectorPushForwardModeVisitor : public VectorForwardModeVisitor { | ||
|
||
public: | ||
VectorPushForwardModeVisitor(DerivativeBuilder& builder); | ||
~VectorPushForwardModeVisitor() override; | ||
|
||
void ExecuteInsidePushforwardFunctionBlock() override; | ||
|
||
StmtDiff VisitReturnStmt(const clang::ReturnStmt* RS) override; | ||
}; | ||
} // end namespace clad | ||
|
||
#endif // CLAD_DIFFERENTIATOR_VECTORPUSHFORWARDMODEVISITOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.