-
Notifications
You must be signed in to change notification settings - Fork 122
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
16 changed files
with
499 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_DIFFERENTIATOR_PUSHFORWARDMODEVISITOR_H | ||
#define CLAD_DIFFERENTIATOR_PUSHFORWARDMODEVISITOR_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 : public BaseForwardModeVisitor { | ||
|
||
public: | ||
PushForwardModeVisitor(DerivativeBuilder& builder); | ||
~PushForwardModeVisitor() override; | ||
|
||
StmtDiff VisitReturnStmt(const clang::ReturnStmt* RS) override; | ||
}; | ||
} // end namespace clad | ||
|
||
#endif // CLAD_DIFFERENTIATOR_PUSHFORWARDMODEVISITOR_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.