.. 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 ReqExplicit .. java:import:: fr.inria.tapenade.representation ArrayDim .. java:import:: fr.inria.tapenade.representation ArrayTypeSpec .. java:import:: fr.inria.tapenade.representation CallArrow .. java:import:: fr.inria.tapenade.representation CallGraph .. java:import:: fr.inria.tapenade.representation CompositeTypeSpec .. java:import:: fr.inria.tapenade.representation Directive .. java:import:: fr.inria.tapenade.representation FieldDecl .. java:import:: fr.inria.tapenade.representation FunctionDecl .. java:import:: fr.inria.tapenade.representation FunctionTypeSpec .. 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 MPIcallInfo .. java:import:: fr.inria.tapenade.representation NewSymbolHolder .. java:import:: fr.inria.tapenade.representation PointerTypeSpec .. java:import:: fr.inria.tapenade.representation PrimitiveTypeSpec .. 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 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 .. java:import:: fr.inria.tapenade.representation MixedLanguageInfos .. java:import:: fr.inria.tapenade.utils BoolVector .. java:import:: fr.inria.tapenade.utils ILLang .. java:import:: fr.inria.tapenade.utils TapIntList .. java:import:: fr.inria.tapenade.utils TapPair .. java:import:: fr.inria.tapenade.utils TapTriplet .. java:import:: fr.inria.tapenade.utils ToObject .. java:import:: fr.inria.tapenade.utils Tree ProcedureCallDifferentiator =========================== .. java:package:: fr.inria.tapenade.differentiation :noindex: .. java:type:: public class ProcedureCallDifferentiator Object that differentiates procedure calls. In cooperation with a BlockDifferentiator, for each given procedure call, tells this BlockDifferentiator which instructions must be added to the fwdBlock and (optional) bwdBlock of the current curBlock. Constructors ------------ ProcedureCallDifferentiator ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:constructor:: protected ProcedureCallDifferentiator(DifferentiationEnv adEnv) :outertype: ProcedureCallDifferentiator Methods ------- buildDiffInstructions ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void buildDiffInstructions(Tree callTree, Tree resultTree, int differentiationMode, Unit calledUnit, ActivityPattern calledActivity, boolean mustDiffCall, boolean callIsLive, boolean mustSaveTBRBeforeInstr, boolean normalCheckpointedCall, boolean splitAdjointCall, SymbolTable fwdSymbolTable, SymbolTable bwdSymbolTable, BoolVector beforeActiv, BoolVector afterActiv, BoolVector beforeUseful, BoolVector afterUseful, BoolVector beforeReqX, BoolVector afterReqX, BoolVector beforeAvlX) :outertype: ProcedureCallDifferentiator Build the derivative instructions for a source procedure call "callTree", with its result (whan procedure is in fact a function) assigned to a source "resultTree". The new derivative instructions are inserted into -- the future block in the future forward sweep (in their future final order) through addFuture*NodeFwd() calls, -- the future block in the future backward sweep (in the inverse of their future final order) through addFuture*NodeBwd() calls, -- the block for derivative declarations for a SPLIT BWD code (in their future final order) through addFutureSetDiffNodeBwd() calls (happens only for declaration instructions). :param differentiationMode: the differentiation mode requested in {TANGENT_MODE, ADJOINT_MODE, ADJOINT_SPLIT_MODE}. :param calledUnit: the Unit of the called procedure :param calledActivity: the activity pattern of the called Unit which is called here. :param mustDiffCall: true when this call is active, i.e. we need to compute derivatives about it :param callIsLive: true when the primal call is diff-live, i.e. cannot be simply removed from the diff code :param mustSaveTBRBeforeInstr: true when some TBR values must be PUSH/POPPED before this call :param splitAdjointCall: true when the adjoint of this call must be SPLIT (call foo_fwd() ... call foo_bwd()) :param normalCheckpointedCall: false if splitAdjointCall or in TANGENT_MODE or inside context code :param fwdSymbolTable: the SymbolTable of the forward sweep where the derivative instructions will go :param bwdSymbolTable: the SymbolTable of the backward sweep where the derivative instructions will go buildDiffInstructionsOfMPICall ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void buildDiffInstructionsOfMPICall(Tree callTree, Tree result, int differentiationMode, Unit calledUnit, ActivityPattern calledActivity, MPIcallInfo messagePassingInfo, boolean mustDiffOperation, SymbolTable fwdSymbolTable, SymbolTable bwdSymbolTable, BoolVector beforeActiv, BoolVector afterActiv, BoolVector beforeUseful, BoolVector afterUseful) :outertype: ProcedureCallDifferentiator Build the derivative instructions that come from the given source "tree", which is an MPI call. This builds the list that must go into the block of the forward sweep (in their future final execution order) and the list that must go into the block of the backward sweep (in the inverse of their future final execution order) diffFunctionIsFunction ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected boolean diffFunctionIsFunction(Unit unit) :outertype: ProcedureCallDifferentiator :return: true if the diff of unit will be a function. differentiateProcedureHeader ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected Tree differentiateProcedureHeader(Tree headerTree, Tree lhs, ToObject toDiffLhs, ActivityPattern calledActivity, SymbolTable diffSymbolTable, SymbolTable interfaceSymbolTable, int diffHeaderMode, TapList> toDuplicateVars) :outertype: ProcedureCallDifferentiator Compute a differentiated call, for the header Tree in the EntryBlock of a diffUnit (OR for a differentiated call in the special case of the ADJOINT_SPLIT call FWD OR for a differentiated call from a context procedure). :param headerTree: The primal header. Its head operator is ILLang.op_call. :param lhs: The actual variable that receives the result of the call. Should be non-null ONLY when differentiateProcedureHeader() is called on a FUNCTION CALL. :param toDiffLhs: When given non-null, holds upon exit the future lhs of the differentiated call. Should be non-null ONLY when differentiateProcedureHeader() is called on a FUNCTION CALL. :param calledActivity: The ActivityPattern of the routine refered to by this function call. Should be non-null ONLY when differentiateProcedureHeader() is called on a function CALL otherwise should be null and curActivity will be used. :param diffSymbolTable: The SymbolTable that will host the returned differentiated Tree. :param diffHeaderMode: The current differentiation mode, one of {ORIGCOPY, TANGENT, ADJOINT, ADJOINT_FWD, ADJOINT_BWD}