43#include "../../misc/byteDataView.hpp"
45#include "vectorAccessInterface.hpp"
66 template<
typename T_Tape,
typename T_Real,
typename T_Identifier>
80 void* functions[(size_t)LowLevelFunctionEntryCallKind::MaxElement];
81 using FunctionTypes = std::tuple<FuncEval, FuncEval, FuncEval, FuncDel>;
88 : functions{(void*)forward, (void*)reverse, (void*)primal, (void*)del} {}
92 void call(Args&&... args)
const {
93 using FuncType =
typename std::tuple_element<(size_t)callType, FunctionTypes>::type;
94 ((FuncType)functions[(
size_t)callType])(std::forward<Args>(args)...);
99 bool has(Args&&... args)
const {
101 return nullptr != functions[(size_t)callType];
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
LowLevelFunctionEntryCallKind
All possible call types for a low level function entry.
Definition lowLevelFunctionEntry.hpp:51
Definition byteDataView.hpp:51
Low level function entry on the tape. See LowLevelFunctionTapeInterface for details.
Definition lowLevelFunctionEntry.hpp:67
void(*)(Tape *tape, ByteDataView &data) FuncDel
Call syntax for Delete calls.
Definition lowLevelFunctionEntry.hpp:76
T_Real Real
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:69
void call(Args &&... args) const
Call the function corresponding to callType with the given arguments.
Definition lowLevelFunctionEntry.hpp:92
T_Tape Tape
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:68
bool has(Args &&... args) const
Check if a function is provided for the callType.
Definition lowLevelFunctionEntry.hpp:99
T_Identifier Identifier
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:70
LowLevelFunctionEntry(FuncEval reverse=nullptr, FuncEval forward=nullptr, FuncEval primal=nullptr, FuncDel del=nullptr)
Constructors.
Definition lowLevelFunctionEntry.hpp:86
void(*)(Tape *tape, ByteDataView &data, VectorAccessInterface< Real, Identifier > *access) FuncEval
Call syntax for Forward, Reverse, and Primal calls.
Definition lowLevelFunctionEntry.hpp:73
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:91