.. java:import:: fr.inria.tapenade.analysis ADActivityAnalyzer .. java:import:: fr.inria.tapenade.analysis ADTBRAnalyzer .. java:import:: fr.inria.tapenade.analysis ActivityPattern .. java:import:: fr.inria.tapenade.analysis DataFlowAnalyzer .. java:import:: fr.inria.tapenade.analysis DiffLivenessAnalyzer .. java:import:: fr.inria.tapenade.analysis InOutAnalyzer .. java:import:: fr.inria.tapenade.analysis ReqExplicit .. java:import:: fr.inria.tapenade.representation AlignmentBoundary .. java:import:: fr.inria.tapenade.representation ArrayDim .. java:import:: fr.inria.tapenade.representation BasicBlock .. java:import:: fr.inria.tapenade.representation Block .. java:import:: fr.inria.tapenade.representation BlockStorage .. java:import:: fr.inria.tapenade.representation CallGraph .. java:import:: fr.inria.tapenade.representation CallArrow .. java:import:: fr.inria.tapenade.representation Directive .. java:import:: fr.inria.tapenade.representation EntryBlock .. java:import:: fr.inria.tapenade.representation ExitBlock .. java:import:: fr.inria.tapenade.representation FGArrow .. java:import:: fr.inria.tapenade.representation FGConstants .. java:import:: fr.inria.tapenade.representation FunctionDecl .. java:import:: fr.inria.tapenade.representation ModifiedTypeSpec .. java:import:: fr.inria.tapenade.representation FunctionTypeSpec .. java:import:: fr.inria.tapenade.representation PointerTypeSpec .. java:import:: fr.inria.tapenade.representation HeaderBlock .. java:import:: fr.inria.tapenade.representation ILUtils .. java:import:: fr.inria.tapenade.representation Instruction .. java:import:: fr.inria.tapenade.representation IterDescriptor .. java:import:: fr.inria.tapenade.representation LoopBlock .. java:import:: fr.inria.tapenade.representation MemoryMaps .. java:import:: fr.inria.tapenade.representation MemMap .. java:import:: fr.inria.tapenade.representation NewSymbolHolder .. java:import:: fr.inria.tapenade.representation RefDescriptor .. java:import:: fr.inria.tapenade.representation SymbolDecl .. java:import:: fr.inria.tapenade.representation SymbolTable .. java:import:: fr.inria.tapenade.representation SymbolTableConstants .. java:import:: fr.inria.tapenade.representation TapEnv .. java:import:: fr.inria.tapenade.representation TapList .. java:import:: fr.inria.tapenade.representation TemporaryBlock .. java:import:: fr.inria.tapenade.representation TypeSpec .. java:import:: fr.inria.tapenade.representation Unit .. java:import:: fr.inria.tapenade.representation VariableDecl .. java:import:: fr.inria.tapenade.representation WrapperTypeSpec .. java:import:: fr.inria.tapenade.representation ZoneInfo FlowGraphDifferentiator ======================= .. java:package:: fr.inria.tapenade.differentiation :noindex: .. java:type:: public final class FlowGraphDifferentiator Differentiator for the flow of control given as a FlowGraph. Fields ------ debugPointsCounter ^^^^^^^^^^^^^^^^^^ .. java:field:: protected int debugPointsCounter :outertype: FlowGraphDifferentiator Counter used by BlockDifferentiator to number the various debug points. keepEmptyDiffBlocks ^^^^^^^^^^^^^^^^^^^ .. java:field:: protected boolean keepEmptyDiffBlocks :outertype: FlowGraphDifferentiator True when we are in a (debug) mode such that empty diff Blocks must be kept. returnedVariable ^^^^^^^^^^^^^^^^ .. java:field:: protected Tree returnedVariable :outertype: FlowGraphDifferentiator For ADJOINT diff of a function Unit, communicates the new temporary variable used to hold the returned value. Variable is created in BlockDifferentiator, and used here. toBranchVariable ^^^^^^^^^^^^^^^^ .. java:field:: protected TapPair toBranchVariable :outertype: FlowGraphDifferentiator Container for the NewSymbolHolder of the integer variable used to store the POP'ped branch, plus its future type. toChunklengthVariable ^^^^^^^^^^^^^^^^^^^^^ .. java:field:: protected TapList toChunklengthVariable :outertype: FlowGraphDifferentiator Container for the NewSymbolHolder of the integer variable used to store the allocated size. toChunkoldVariable ^^^^^^^^^^^^^^^^^^ .. java:field:: protected TapList toChunkoldVariable :outertype: FlowGraphDifferentiator Container for the NewSymbolHolder of the address variable used to store the address allocated during the forward sweep. toDiffchunkoldVariable ^^^^^^^^^^^^^^^^^^^^^^ .. java:field:: protected TapList toDiffchunkoldVariable :outertype: FlowGraphDifferentiator Container for the NewSymbolHolder of the address variable used to store the DIFF address allocated during the forward sweep. toFwdChunklengthVariable ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:field:: protected TapList toFwdChunklengthVariable :outertype: FlowGraphDifferentiator For ADJOINT_SPLIT_MODE, container for the NewSymbolHolder of the integer variable used to store the allocated size in the split FWD sweep. For other modes, this container is equal to toChunklengthVariable. Constructors ------------ FlowGraphDifferentiator ^^^^^^^^^^^^^^^^^^^^^^^ .. java:constructor:: protected FlowGraphDifferentiator(DifferentiationEnv adEnv) :outertype: FlowGraphDifferentiator Methods ------- declareDiffIsReturnVar ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void declareDiffIsReturnVar(VariableDecl returnVarDecl, Unit unit, Unit diffUnit) :outertype: FlowGraphDifferentiator differentiateProcedure ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void differentiateProcedure() :outertype: FlowGraphDifferentiator Differentiate the procedure "unit", i.e. for each differentiation mode required, fill the empty diffUnit that has been created (empty) beforehand. differentiateSaveList ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void differentiateSaveList(SymbolTable diffSymbolTable) :outertype: FlowGraphDifferentiator Differentiate Fortran save attributes. :param diffSymbolTable: curDiffUnit symbolTable. getIterationsBetweenPushAndPop ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList getIterationsBetweenPushAndPop(Block block) :outertype: FlowGraphDifferentiator :return: the list of enclosing loops of the given "block" that will "separate" block_FWD and block_BWD, i.e. block_FWD and block_BWD will be each in its own separate nest of these loops, instead of both inside the same loop nest (which may happen e.g. if we reach an enclosing level which is checkpointed). Returned list is ordered, outermost loop first. Special case: when we reach the topmost FlowGraphLevel without having seen any checkpoint, then the returned list starts with a null. initializeMultiDirMode ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void initializeMultiDirMode() :outertype: FlowGraphDifferentiator Initialization if -multi option. initializeMultiDirNumberMax ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void initializeMultiDirNumberMax() :outertype: FlowGraphDifferentiator Prepare the NewSymbolHolder that contains variable "NBDirsMax" for the differentiated Unit "curDiffUnit". This initialization will be done only once for each curDiffUnit. instructionsOnDeclaredZones ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected TapList instructionsOnDeclaredZones(Tree instrumentedSourceTree, SymbolTable srcSymbolTable, SymbolTable diffSymbolTable, String traceFuncPrefix, Unit diffUnit, BoolVector placeActiveZones, int[] map, boolean adaptForDD, boolean modifiesPrimal, boolean modifiesDiff, int lastDeclaredZone, Instruction returnInstr) :outertype: FlowGraphDifferentiator Build the list of the Trees of trace, debug, or initialization calls to be placed around the given instrumentedSourceTree (generally a call) for each active declared zone in the given symbolTable "srcSymbolTable", all these trace etc calls starting with the given trace function name prefix "traceFuncPrefix". :param instrumentedSourceTree: the source Tree of the differentiated Tree that we are instrumenting. :param srcSymbolTable: the source SymbolTable of the instrumentedSourceTree :param diffSymbolTable: the SymbolTable of the future created trees :param placeActiveZones: the vector of all the zones that we want to instrument. This vector follows the numbering of the declared "diffKind" zones of the context/calling function. :param modifiesPrimal: Pass "true" when the created operation needs to modify the primal variable. :param modifiesDiff: Pass "true" when the created operation needs to modify the diff variable. :param returnInstr: the return instruction, needed to find the returned expression. :return: the list of the Trees of trace, debug, or initialization calls for each active declared zone in the given symbolTable "srcSymbolTable", all these calls starting with the given trace function name prefix "traceFuncPrefix". placeDebugADTests ^^^^^^^^^^^^^^^^^ .. java:method:: protected Tree placeDebugADTests(Unit diffUnit, Tree callTree, BoolVector placeActiveZones, int[] map, int nature, SymbolTable srcSymbolTable, int lastDeclaredZone, String placeName, Instruction returnInstr, Tree okHere, Tree forcedOkHere) :outertype: FlowGraphDifferentiator :param diffUnit: the differentiated Unit that contains the instrumented place :param callTree: when the instrumented place is a call, this call. :param nature: indicates the nature of the corresponding point in the original source, i.e. -1:sourceEntry ; 1:sourceExit ; -2:upstreamSourceCall ; 2:downstreamSourceCall ; 0:elsewhere :param returnInstr: the return instruction. :return: the instrumentation Instructions for this nature of location and for this debug AD mode.