43#include "../../misc/byteDataView.hpp"
45#include "vectorAccessInterface.hpp"
68 template<
typename T_Tape,
typename T_Real,
typename T_Identifier>
87 void* functions[(size_t)LowLevelFunctionEntryCallKind::MaxElement];
89 std::tuple<FuncEval, FuncEval, FuncEval, FuncDel, FuncIterate, FuncIterate>;
96 : functions{(void*)forward, (void*)reverse, (void*)primal, (void*)del, (void*)iterIn, (void*)iterOut} {}
100 void call(Args&&... args)
const {
101 using FuncType =
typename std::tuple_element<(size_t)callType, FunctionTypes>::type;
102 ((FuncType)functions[(size_t)callType])(std::forward<Args>(args)...);
107 bool has(Args&&... args)
const {
109 return nullptr != functions[(size_t)callType];
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:97
CoDiPack - Code Differentiation Package.
Definition codi.hpp:97
LowLevelFunctionEntryCallKind
All possible call types for a low level function entry.
Definition lowLevelFunctionEntry.hpp:51
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:55
Definition byteDataView.hpp:51
void(*)(Tape *tape, ByteDataView &data, IterCallback func, void *userData) FuncIterate
Call syntax for IterateInputs and IterateOutputs calls.
Definition lowLevelFunctionEntry.hpp:83
LowLevelFunctionEntry(FuncEval reverse=nullptr, FuncEval forward=nullptr, FuncEval primal=nullptr, FuncDel del=nullptr, FuncIterate iterIn=nullptr, FuncIterate iterOut=nullptr)
Constructors.
Definition lowLevelFunctionEntry.hpp:94
void(*)(Tape *tape, ByteDataView &data) FuncDel
Call syntax for Delete calls.
Definition lowLevelFunctionEntry.hpp:78
T_Real Real
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:71
void call(Args &&... args) const
Call the function corresponding to callType with the given arguments.
Definition lowLevelFunctionEntry.hpp:100
T_Tape Tape
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:70
bool has(Args &&... args) const
Check if a function is provided for the callType.
Definition lowLevelFunctionEntry.hpp:107
T_Identifier Identifier
See LowLevelFunctionEntry.
Definition lowLevelFunctionEntry.hpp:72
void(*)(Identifier *id, void *userData) IterCallback
Callback function for the identifier iteration.
Definition lowLevelFunctionEntry.hpp:81
void(*)(Tape *tape, ByteDataView &data, VectorAccessInterface< Real, Identifier > *access) FuncEval
Call syntax for Forward, Reverse, and Primal calls.
Definition lowLevelFunctionEntry.hpp:75
Unified access to the adjoint vector and primal vector in a tape evaluation.
Definition vectorAccessInterface.hpp:94