|
Enzyme main
|
#include "MLIR/Interfaces/GradientUtils.h"


Public Member Functions | |
| void | registerGradientCreatorHook (std::function< Value(Location, Type)> hook) |
| void | deregisterGradientCreatorHook (std::function< Value(Location, Type)> hook) |
| Value | getNewGradient (Location loc, Type t) |
| mlir::Value | getDifferential (mlir::Value origv) |
| void | setDiffe (mlir::Value origv, mlir::Value newv, mlir::OpBuilder &builder) |
| void | zeroDiffe (mlir::Value origv, mlir::OpBuilder &builder) |
| mlir::Value | diffe (mlir::Value origv, mlir::OpBuilder &builder) |
| MDiffeGradientUtils (MEnzymeLogic &Logic, FunctionOpInterface newFunc_, FunctionOpInterface oldFunc_, MTypeAnalysis &TA, MTypeResults TR, IRMapping &invertedPointers_, const llvm::ArrayRef< bool > returnPrimals, const llvm::ArrayRef< bool > returnShadows, const SmallPtrSetImpl< mlir::Value > &constantvalues_, const SmallPtrSetImpl< mlir::Value > &activevals_, ArrayRef< DIFFE_TYPE > RetActivity, ArrayRef< DIFFE_TYPE > ArgActivity, IRMapping &origToNew_, std::map< Operation *, Operation * > &origToNewOps_, DerivativeMode mode, unsigned width, bool omp, llvm::StringRef postpasses, bool verifyPostPasses, bool strongZero) | |
Public Member Functions inherited from mlir::enzyme::MGradientUtils | |
| SmallVector< mlir::Value, 1 > | getNewFromOriginal (ValueRange originst) const |
| mlir::Value | getNewFromOriginal (const mlir::Value originst) const |
| mlir::Block * | getNewFromOriginal (mlir::Block *originst) const |
| Operation * | getNewFromOriginal (Operation *originst) const |
| MGradientUtils (MEnzymeLogic &Logic, FunctionOpInterface newFunc_, FunctionOpInterface oldFunc_, MTypeAnalysis &TA_, MTypeResults TR_, IRMapping &invertedPointers_, const llvm::ArrayRef< bool > returnPrimals, const llvm::ArrayRef< bool > returnShadows, const SmallPtrSetImpl< mlir::Value > &constantvalues_, const SmallPtrSetImpl< mlir::Value > &activevals_, ArrayRef< DIFFE_TYPE > ReturnActivities, ArrayRef< DIFFE_TYPE > ArgDiffeTypes_, IRMapping &originalToNewFn_, std::map< Operation *, Operation * > &originalToNewFnOps_, DerivativeMode mode, unsigned width, bool omp, llvm::StringRef postpasses, bool verifyPostPasses, bool strongZero) | |
| void | erase (Operation *op) |
| void | replaceOrigOpWith (Operation *op, ValueRange vals) |
| void | eraseIfUnused (Operation *op, bool erase=true, bool check=true) |
| bool | isConstantInstruction (mlir::Operation *v) const |
| bool | isConstantValue (mlir::Value v) const |
| mlir::Value | invertPointerM (mlir::Value v, OpBuilder &Builder2) |
| void | forceAugmentedReturns () |
| Operation * | cloneWithNewOperands (OpBuilder &B, Operation *op) |
| LogicalResult | visitChild (Operation *op) |
| void | setDiffe (mlir::Value origv, mlir::Value newv, mlir::OpBuilder &builder) |
| void | setInvertedPointer (mlir::Value origv, mlir::Value newv) |
| mlir::Type | getShadowType (mlir::Type T) |
Static Public Member Functions | |
| static MDiffeGradientUtils * | CreateFromClone (MEnzymeLogic &Logic, DerivativeMode mode, unsigned width, FunctionOpInterface todiff, MTypeAnalysis &TA, MFnTypeInfo &oldTypeInfo, const llvm::ArrayRef< bool > returnPrimals, const llvm::ArrayRef< bool > returnShadows, ArrayRef< DIFFE_TYPE > RetActivity, ArrayRef< DIFFE_TYPE > ArgActivity, mlir::Type additionalArg, bool omp, llvm::StringRef postpasses, bool verifyPostPasses, bool strongZero) |
Static Public Member Functions inherited from mlir::enzyme::MGradientUtils | |
| static llvm::SmallVector< mlir::Value, 1 > | reindex_arguments (llvm::ArrayRef< mlir::Value > vals, mlir::OperandRange range) |
Protected Attributes | |
| IRMapping | differentials |
| Block * | initializationBlock |
| SmallVector< std::function< Value(Location, Type)> > | gradientCreatorHook |
Additional Inherited Members | |
Public Attributes inherited from mlir::enzyme::MGradientUtils | |
| FunctionOpInterface | newFunc |
| MEnzymeLogic & | Logic |
| bool | AtomicAdd |
| DerivativeMode | mode |
| FunctionOpInterface | oldFunc |
| IRMapping | invertedPointers |
| IRMapping | originalToNewFn |
| std::map< Operation *, Operation * > | originalToNewFnOps |
| SmallPtrSet< Block *, 4 > | blocksNotForAnalysis |
| DenseMap< Operation *, bool > | readOnlyCache |
| std::unique_ptr< enzyme::ActivityAnalyzer > | activityAnalyzer |
| MTypeAnalysis & | TA |
| MTypeResults | TR |
| bool | omp |
| bool | verifyPostPasses |
| llvm::StringRef | postpasses |
| bool | strongZero |
| const llvm::ArrayRef< bool > | returnPrimals |
| const llvm::ArrayRef< bool > | returnShadows |
| unsigned | width |
| ArrayRef< DIFFE_TYPE > | ArgDiffeTypes |
| ArrayRef< DIFFE_TYPE > | RetDiffeTypes |
Definition at line 109 of file GradientUtils.h.
|
inline |
Definition at line 129 of file GradientUtils.h.
|
inlinestatic |
Definition at line 150 of file GradientUtils.h.
| void MDiffeGradientUtils::deregisterGradientCreatorHook | ( | std::function< Value(Location, Type)> | hook | ) |
Definition at line 149 of file GradientUtils.cpp.
References gradientCreatorHook.
| mlir::Value mlir::enzyme::MDiffeGradientUtils::diffe | ( | mlir::Value | origv, |
| mlir::OpBuilder & | builder ) |
Definition at line 204 of file GradientUtils.cpp.
References getShadowType().
Referenced by mlir::enzyme::MEnzymeLogic::CreateReverseDiff(), AutoDiffCallRev::createReverseModeAdjoint(), and mlir::enzyme::MEnzymeLogic::handlePredecessors().
| mlir::Value mlir::enzyme::MDiffeGradientUtils::getDifferential | ( | mlir::Value | origv | ) |
Definition at line 173 of file GradientUtils.cpp.
Referenced by mlir::enzyme::localizeGradients().
| Value MDiffeGradientUtils::getNewGradient | ( | Location | loc, |
| Type | t ) |
Definition at line 155 of file GradientUtils.cpp.
| void MDiffeGradientUtils::registerGradientCreatorHook | ( | std::function< Value(Location, Type)> | hook | ) |
Definition at line 143 of file GradientUtils.cpp.
References gradientCreatorHook.
| void mlir::enzyme::MDiffeGradientUtils::setDiffe | ( | mlir::Value | origv, |
| mlir::Value | newv, | ||
| mlir::OpBuilder & | builder ) |
Definition at line 183 of file GradientUtils.cpp.
References mlir::enzyme::MGradientUtils::setDiffe().
| void mlir::enzyme::MDiffeGradientUtils::zeroDiffe | ( | mlir::Value | origv, |
| mlir::OpBuilder & | builder ) |
Definition at line 196 of file GradientUtils.cpp.
References getShadowType().
Referenced by mlir::enzyme::MEnzymeLogic::handlePredecessors().
|
protected |
Definition at line 111 of file GradientUtils.h.
|
protected |
Definition at line 114 of file GradientUtils.h.
Referenced by deregisterGradientCreatorHook(), and registerGradientCreatorHook().
|
protected |
Definition at line 113 of file GradientUtils.h.
Referenced by GradientUtils::GradientUtils().