Enzyme main
Loading...
Searching...
No Matches
mlir::enzyme::MEnzymeLogic Class Reference

#include "MLIR/Interfaces/EnzymeLogic.h"

Collaboration diagram for mlir::enzyme::MEnzymeLogic:

Classes

struct  MForwardCacheKey
 
struct  MReverseCacheKey
 

Public Member Functions

FunctionOpInterface CreateForwardDiff (FunctionOpInterface fn, std::vector< DIFFE_TYPE > retType, std::vector< DIFFE_TYPE > constants, MTypeAnalysis &TA, std::vector< bool > returnPrimals, DerivativeMode mode, bool freeMemory, size_t width, mlir::Type addedType, MFnTypeInfo type_args, std::vector< bool > volatile_args, void *augmented, bool omp, llvm::StringRef postpasses, bool verifyPostPasses, bool strongZero)
 
FunctionOpInterface CreateReverseDiff (FunctionOpInterface fn, std::vector< DIFFE_TYPE > retType, std::vector< DIFFE_TYPE > constants, MTypeAnalysis &TA, std::vector< bool > returnPrimals, std::vector< bool > returnShadows, DerivativeMode mode, bool freeMemory, size_t width, mlir::Type addedType, MFnTypeInfo type_args, std::vector< bool > volatile_args, void *augmented, bool omp, llvm::StringRef postpasses, bool verifyPostPasses, bool strongZero)
 
void initializeShadowValues (SmallVector< mlir::Block * > &dominatorToposortBlocks, MGradientUtilsReverse *gutils)
 
void handlePredecessors (Block *oBB, Block *newBB, Block *reverseBB, MGradientUtilsReverse *gutils, llvm::function_ref< buildReturnFunction > buildReturnOp)
 
LogicalResult visitChildren (Block *oBB, Block *reverseBB, MGradientUtilsReverse *gutils)
 
LogicalResult visitChild (Operation *op, OpBuilder &builder, MGradientUtilsReverse *gutils)
 
void mapInvertArguments (Block *oBB, Block *reverseBB, MGradientUtilsReverse *gutils)
 
LogicalResult differentiate (MGradientUtilsReverse *gutils, Region &oldRegion, Region &newRegion, llvm::function_ref< buildReturnFunction > buildFuncRetrunOp, std::function< std::pair< Value, Value >(Type)> cacheCreator)
 

Public Attributes

std::map< MForwardCacheKey, FunctionOpInterface > ForwardCachedFunctions
 
std::map< MReverseCacheKey, FunctionOpInterface > ReverseCachedFunctions
 

Detailed Description

Definition at line 46 of file EnzymeLogic.h.

Member Function Documentation

◆ CreateForwardDiff()

FunctionOpInterface mlir::enzyme::MEnzymeLogic::CreateForwardDiff ( FunctionOpInterface fn,
std::vector< DIFFE_TYPE > retType,
std::vector< DIFFE_TYPE > constants,
MTypeAnalysis & TA,
std::vector< bool > returnPrimals,
DerivativeMode mode,
bool freeMemory,
size_t width,
mlir::Type addedType,
MFnTypeInfo type_args,
std::vector< bool > volatile_args,
void * augmented,
bool omp,
llvm::StringRef postpasses,
bool verifyPostPasses,
bool strongZero )

Definition at line 78 of file EnzymeLogic.cpp.

References ForwardCachedFunctions.

Referenced by AutoDiffCallFwd::createForwardModeTangent().

◆ CreateReverseDiff()

FunctionOpInterface MEnzymeLogic::CreateReverseDiff ( FunctionOpInterface fn,
std::vector< DIFFE_TYPE > retType,
std::vector< DIFFE_TYPE > constants,
MTypeAnalysis & TA,
std::vector< bool > returnPrimals,
std::vector< bool > returnShadows,
DerivativeMode mode,
bool freeMemory,
size_t width,
mlir::Type addedType,
MFnTypeInfo type_args,
std::vector< bool > volatile_args,
void * augmented,
bool omp,
llvm::StringRef postpasses,
bool verifyPostPasses,
bool strongZero )

◆ differentiate()

◆ handlePredecessors()

◆ initializeShadowValues()

void mlir::enzyme::MEnzymeLogic::initializeShadowValues ( SmallVector< mlir::Block * > & dominatorToposortBlocks,
MGradientUtilsReverse * gutils )

◆ mapInvertArguments()

void mlir::enzyme::MEnzymeLogic::mapInvertArguments ( Block * oBB,
Block * reverseBB,
MGradientUtilsReverse * gutils )

◆ visitChild()

LogicalResult MEnzymeLogic::visitChild ( Operation * op,
OpBuilder & builder,
MGradientUtilsReverse * gutils )

◆ visitChildren()

LogicalResult MEnzymeLogic::visitChildren ( Block * oBB,
Block * reverseBB,
MGradientUtilsReverse * gutils )

Definition at line 68 of file EnzymeLogicReverse.cpp.

References visitChild().

Referenced by differentiate().

Member Data Documentation

◆ ForwardCachedFunctions

std::map<MForwardCacheKey, FunctionOpInterface> mlir::enzyme::MEnzymeLogic::ForwardCachedFunctions

Definition at line 215 of file EnzymeLogic.h.

Referenced by CreateForwardDiff().

◆ ReverseCachedFunctions

std::map<MReverseCacheKey, FunctionOpInterface> mlir::enzyme::MEnzymeLogic::ReverseCachedFunctions

Definition at line 216 of file EnzymeLogic.h.

Referenced by CreateReverseDiff().


The documentation for this class was generated from the following files: