ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ADOLC::detail::TapeRecordingContext Struct Reference

Mutable buffers and bookkeeping used while recording a tape. More...

#include <taperecordingcontext.h>

Collaboration diagram for ADOLC::detail::TapeRecordingContext:
Collaboration graph
[legend]

Public Types

using StatEntries = TapeInfos::StatEntries
 

Public Member Functions

 ~TapeRecordingContext ()
 
 TapeRecordingContext ()=default
 
 TapeRecordingContext (const TapeRecordingContext &)=delete
 
TapeRecordingContext & operator= (const TapeRecordingContext &)=delete
 
 TapeRecordingContext (TapeRecordingContext &&other) noexcept
 
TapeRecordingContext & operator= (TapeRecordingContext &&other) noexcept
 
void put_loc (size_t loc)
 
template<InfoType< TapeRecordingContext, ErrorType > Info>
void openFile (const char *fileName)
 Ensure that the tape file associated with Info exists and is ready for writing.
 
template<InfoType< TapeRecordingContext, ErrorType > Info>
void put_block (const char *fileName, size_t lengthBlock)
 Flush the current in-memory tape buffer to disk.
 
void put_vals_notWriteBlock (double *vals, size_t numVals)
 
void put_op (OPCODES op, const char *loc_fileName, const char *op_fileName, const char *val_fileName, size_t reserveExtraLocations=0)
 
void put_vals_writeBlock (double *vals, size_t numVals, const char *op_fileName, const char *val_fileName)
 
size_t get_val_space (const char *op_fileName, const char *val_fileName)
 
void write_scaylor (double val, const char *tay_fileName)
 
void write_scaylors (const double *taylorCoefficientPos, std::ptrdiff_t size, const char *tay_fileName)
 
int upd_resloc (size_t temp, size_t lhs)
 
int upd_resloc_check (const size_t temp)
 
int upd_resloc_inc_prod (size_t temp, size_t newlhs, unsigned char newop)
 

Public Attributes

ADOLC::detail::OpBuffer opBuffer_ {}
 
ADOLC::detail::ValBuffer valBuffer_ {}
 
ADOLC::detail::LocBuffer locBuffer_ {}
 
ADOLC::detail::TayBuffer tayBuffer_ {}
 
size_t numInds {0}
 
size_t numDeps {0}
 
int keepTaylors {0}
 
size_t num_eq_prod {0}
 
int deg_save {0}
 
size_t tay_numInds {0}
 
size_t tay_numDeps {0}
 
size_t numSwitches {0}
 
bool nestedReverseEval {false}
 
size_t nextBufferNumber {0}
 
char lastTayBlockInCore {0}
 
double * signature {nullptr}
 
double * paramstore {nullptr}
 

Static Public Attributes

static constexpr StatEntries OP_BUFFER_SIZE = TapeInfos::OP_BUFFER_SIZE
 
static constexpr StatEntries NUM_OPERATIONS = TapeInfos::NUM_OPERATIONS
 
static constexpr StatEntries OP_FILE_ACCESS = TapeInfos::OP_FILE_ACCESS
 
static constexpr StatEntries LOC_BUFFER_SIZE = TapeInfos::LOC_BUFFER_SIZE
 
static constexpr StatEntries NUM_LOCATIONS = TapeInfos::NUM_LOCATIONS
 
static constexpr StatEntries LOC_FILE_ACCESS = TapeInfos::LOC_FILE_ACCESS
 
static constexpr StatEntries VAL_BUFFER_SIZE = TapeInfos::VAL_BUFFER_SIZE
 
static constexpr StatEntries NUM_VALUES = TapeInfos::NUM_VALUES
 
static constexpr StatEntries VAL_FILE_ACCESS = TapeInfos::VAL_FILE_ACCESS
 
static constexpr StatEntries TAY_BUFFER_SIZE = TapeInfos::TAY_BUFFER_SIZE
 
static constexpr StatEntries NUM_TAYS = TapeInfos::NUM_TAYS
 

Detailed Description

Mutable buffers and bookkeeping used while recording a tape.

The context owns the canonical tape buffers. Evaluation contexts may temporarily take ownership in exclusive mode or create non-owning views in shared mode.

Member Typedef Documentation

◆ StatEntries

Constructor & Destructor Documentation

◆ ~TapeRecordingContext()

ADOLC::detail::TapeRecordingContext::~TapeRecordingContext ( )
inline

◆ TapeRecordingContext() [1/3]

ADOLC::detail::TapeRecordingContext::TapeRecordingContext ( )
default

◆ TapeRecordingContext() [2/3]

ADOLC::detail::TapeRecordingContext::TapeRecordingContext ( const TapeRecordingContext &  )
delete

◆ TapeRecordingContext() [3/3]

ADOLC::detail::TapeRecordingContext::TapeRecordingContext ( TapeRecordingContext &&  other)
inlinenoexcept

Member Function Documentation

◆ get_val_space()

size_t ADOLC::detail::TapeRecordingContext::get_val_space ( const char *  op_fileName,
const char *  val_fileName 
)

◆ openFile()

template<InfoType< TapeRecordingContext, ErrorType > Info>
void ADOLC::detail::TapeRecordingContext::openFile ( const char *  fileName)
inline

Ensure that the tape file associated with Info exists and is ready for writing.

◆ operator=() [1/2]

TapeRecordingContext & ADOLC::detail::TapeRecordingContext::operator= ( const TapeRecordingContext &  )
delete

◆ operator=() [2/2]

TapeRecordingContext & ADOLC::detail::TapeRecordingContext::operator= ( TapeRecordingContext &&  other)
inlinenoexcept

◆ put_block()

template<InfoType< TapeRecordingContext, ErrorType > Info>
void ADOLC::detail::TapeRecordingContext::put_block ( const char *  fileName,
size_t  lengthBlock 
)
inline

Flush the current in-memory tape buffer to disk.

◆ put_loc()

void ADOLC::detail::TapeRecordingContext::put_loc ( size_t  loc)
inline

◆ put_op()

void ADOLC::detail::TapeRecordingContext::put_op ( OPCODES  op,
const char *  loc_fileName,
const char *  op_fileName,
const char *  val_fileName,
size_t  reserveExtraLocations = 0 
)

◆ put_vals_notWriteBlock()

void ADOLC::detail::TapeRecordingContext::put_vals_notWriteBlock ( double *  vals,
size_t  numVals 
)
inline

◆ put_vals_writeBlock()

void ADOLC::detail::TapeRecordingContext::put_vals_writeBlock ( double *  vals,
size_t  numVals,
const char *  op_fileName,
const char *  val_fileName 
)

◆ upd_resloc()

int ADOLC::detail::TapeRecordingContext::upd_resloc ( size_t  temp,
size_t  lhs 
)
inline

◆ upd_resloc_check()

int ADOLC::detail::TapeRecordingContext::upd_resloc_check ( const size_t  temp)
inline

◆ upd_resloc_inc_prod()

int ADOLC::detail::TapeRecordingContext::upd_resloc_inc_prod ( size_t  temp,
size_t  newlhs,
unsigned char  newop 
)
inline

◆ write_scaylor()

void ADOLC::detail::TapeRecordingContext::write_scaylor ( double  val,
const char *  tay_fileName 
)
inline

◆ write_scaylors()

void ADOLC::detail::TapeRecordingContext::write_scaylors ( const double *  taylorCoefficientPos,
std::ptrdiff_t  size,
const char *  tay_fileName 
)

Member Data Documentation

◆ deg_save

int ADOLC::detail::TapeRecordingContext::deg_save {0}

◆ keepTaylors

int ADOLC::detail::TapeRecordingContext::keepTaylors {0}

◆ lastTayBlockInCore

char ADOLC::detail::TapeRecordingContext::lastTayBlockInCore {0}

◆ LOC_BUFFER_SIZE

constexpr StatEntries ADOLC::detail::TapeRecordingContext::LOC_BUFFER_SIZE = TapeInfos::LOC_BUFFER_SIZE
staticconstexpr

◆ LOC_FILE_ACCESS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::LOC_FILE_ACCESS = TapeInfos::LOC_FILE_ACCESS
staticconstexpr

◆ locBuffer_

ADOLC::detail::LocBuffer ADOLC::detail::TapeRecordingContext::locBuffer_ {}

◆ nestedReverseEval

bool ADOLC::detail::TapeRecordingContext::nestedReverseEval {false}

Indicates that reverse evaluation of this tape happens inside an outer tape evaluation.

First-order reverse uses this flag to accumulate adjoints for independent and dependent variables into the outer tape instead of overwriting them.

◆ nextBufferNumber

size_t ADOLC::detail::TapeRecordingContext::nextBufferNumber {0}

◆ num_eq_prod

size_t ADOLC::detail::TapeRecordingContext::num_eq_prod {0}

◆ NUM_LOCATIONS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::NUM_LOCATIONS = TapeInfos::NUM_LOCATIONS
staticconstexpr

◆ NUM_OPERATIONS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::NUM_OPERATIONS = TapeInfos::NUM_OPERATIONS
staticconstexpr

◆ NUM_TAYS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::NUM_TAYS = TapeInfos::NUM_TAYS
staticconstexpr

◆ NUM_VALUES

constexpr StatEntries ADOLC::detail::TapeRecordingContext::NUM_VALUES = TapeInfos::NUM_VALUES
staticconstexpr

◆ numDeps

size_t ADOLC::detail::TapeRecordingContext::numDeps {0}

◆ numInds

size_t ADOLC::detail::TapeRecordingContext::numInds {0}

◆ numSwitches

size_t ADOLC::detail::TapeRecordingContext::numSwitches {0}

◆ OP_BUFFER_SIZE

constexpr StatEntries ADOLC::detail::TapeRecordingContext::OP_BUFFER_SIZE = TapeInfos::OP_BUFFER_SIZE
staticconstexpr

◆ OP_FILE_ACCESS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::OP_FILE_ACCESS = TapeInfos::OP_FILE_ACCESS
staticconstexpr

◆ opBuffer_

ADOLC::detail::OpBuffer ADOLC::detail::TapeRecordingContext::opBuffer_ {}

◆ paramstore

double* ADOLC::detail::TapeRecordingContext::paramstore {nullptr}

◆ signature

double* ADOLC::detail::TapeRecordingContext::signature {nullptr}

◆ TAY_BUFFER_SIZE

constexpr StatEntries ADOLC::detail::TapeRecordingContext::TAY_BUFFER_SIZE = TapeInfos::TAY_BUFFER_SIZE
staticconstexpr

◆ tay_numDeps

size_t ADOLC::detail::TapeRecordingContext::tay_numDeps {0}

◆ tay_numInds

size_t ADOLC::detail::TapeRecordingContext::tay_numInds {0}

◆ tayBuffer_

ADOLC::detail::TayBuffer ADOLC::detail::TapeRecordingContext::tayBuffer_ {}

◆ VAL_BUFFER_SIZE

constexpr StatEntries ADOLC::detail::TapeRecordingContext::VAL_BUFFER_SIZE = TapeInfos::VAL_BUFFER_SIZE
staticconstexpr

◆ VAL_FILE_ACCESS

constexpr StatEntries ADOLC::detail::TapeRecordingContext::VAL_FILE_ACCESS = TapeInfos::VAL_FILE_ACCESS
staticconstexpr

◆ valBuffer_

ADOLC::detail::ValBuffer ADOLC::detail::TapeRecordingContext::valBuffer_ {}

The documentation for this struct was generated from the following file: