DynMemoryDifferentiator

public class DynMemoryDifferentiator

Object that differentiates Dynamic Memory manipulations (e.g. malloc’s and free’s). 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

DynMemoryDifferentiator

protected DynMemoryDifferentiator(DifferentiationEnv adEnv)

Methods

buildDiffInstructionsOfAssignAllocate

protected void buildDiffInstructionsOfAssignAllocate(Tree tree, int differentiationMode, SymbolTable fwdSymbolTable, SymbolTable bwdSymbolTable, BoolVector beforeActiv, BoolVector afterActiv, BoolVector afterReqX, BoolVector beforeAvlX)

Build the derivative instructions that come from the given source “tree”, which is a malloc-like assignment. 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). Iff there is a backward sweep, then we use ADMM to register memory chunks.

buildDiffInstructionsOfDeallocate

protected void buildDiffInstructionsOfDeallocate(Tree tree, int differentiationMode, boolean deallocateIsLive, SymbolTable fwdSymbolTable, SymbolTable bwdSymbolTable, BoolVector beforeActiv, BoolVector afterActiv, BoolVector afterReqX, BoolVector beforeAvlX, BoolVector beforeTBR, BoolVector beforeTBROnDiffPtr)

Build the derivative instructions that come from the given source “tree”, which is a deallocation 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) Iff there is a backward sweep, then we use ADMM to register memory chunks.