CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
config.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include "misc/exceptions.hpp"
#include "tools/cuda/cudaFunctionAttributes.hpp"
Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  codi
 CoDiPack - Code Differentiation Package.
 
namespace  codi::Config
 Configuration options for CoDiPack.
 

Macros

#define CODI_IDE   0
 Can be enabled to allow for auto completion in IDEs.
 

General compiler attributes.

#define CODI_HasCpp20   __cplusplus >= 202002L
 See codi::Config::HasCpp20.
 
bool constexpr codi::Config::HasCpp20 = __cplusplus >= 202002L
 If CoDiPack is compiled with C++20.
 

Type and compile time value declarations

using codi::Config::ArgumentSize = uint8_t
 Type for the number of arguments in statements.
 
size_t constexpr codi::Config::ByteDataChunkSize = 4194304
 Default size of byte chunks used in ChunkedData in reverse tape implementations.
 
size_t constexpr codi::Config::ChunkSize = 2097152
 Default size of chunks (ChunkBase) used in ChunkedData in reverse tape implementations.
 
#define CODI_ByteDataChunkSize   4194304
 See codi::Config::ByteDataChunkSize.
 
#define CODI_ChunkSize   2097152
 See codi::Config::ChunkSize.
 
#define CODI_SmallChunkSize   32768
 See codi::Config::SmallChunkSize.
 
using codi::Config::LowLevelFunctionDataSize = uint16_t
 Size store type for a low level function.
 
size_t constexpr codi::Config::LowLevelFunctionDataSizeMax = std::numeric_limits<LowLevelFunctionDataSize>::max()
 Maximum data size of a low level function.
 
using codi::Config::LowLevelFunctionToken = uint16_t
 Token type for low level functions in the tapes.
 
size_t constexpr codi::Config::LowLevelFunctionTokenInvalid = std::numeric_limits<LowLevelFunctionToken>::max()
 Invalid low level function token.
 
size_t constexpr codi::Config::LowLevelFunctionTokenMaxSize = std::numeric_limits<LowLevelFunctionToken>::max()
 Maximum number of low level functions.
 
size_t constexpr codi::Config::MaxArgumentSize = 253
 Maximum number of arguments in a statement.
 
size_t constexpr codi::Config::SmallChunkSize = 32768
 Default smaller size of chunks (ChunkBase) used in ChunkedData in reverse tape implementations.
 
size_t constexpr codi::Config::StatementInputTag = 255
 Tag for statements that are inputs. Used in linear index management context.
 
size_t constexpr codi::Config::StatementLowLevelFunctionTag = 254
 Statement tag for low level functions.
 

Compile time flags

#define ADJOINT_VECTOR_TYPE   Gradient
 See codi::Config::VariableAdjointInterfaceInPrimalTapes.
 
const bool codi::Config::CheckEmptyStatements = true
 Tapes push statements only if at least one Jacobian was pushed.
 
bool constexpr codi::Config::CheckExpressionArguments = false
 Check for invalid arguments to expressions like division by zero.
 
bool constexpr codi::Config::CheckJacobianIsZero = true
 Ignore Jacobians that are zero in Jacobian based tapes.
 
bool constexpr codi::Config::CheckTapeActivity = true
 Makes it possible to ignore certain code parts. If turned of everything will be recorded.
 
bool constexpr codi::Config::CheckZeroIndex = true
 Ignore active types that are not dependent on any input value in Jacobian tapes.
 
#define CODI_CheckEmptyStatements   true
 See codi::Config::CheckEmptyStatements.
 
#define CODI_CheckExpressionArguments   false
 See codi::Config::CheckExpressionArguments.
 
#define CODI_CheckJacobianIsZero   true
 See codi::Config::CheckJacobianIsZero.
 
#define CODI_CheckTapeActivity   true
 See codi::Config::CheckTapeActivity.
 
#define CODI_CheckZeroIndex   true
 See codi::Config::CheckZeroIndex.
 
#define CODI_CopyOptimization   true
 See codi::Config::CopyOptimization.
 
#define CODI_IgnoreIntelNoInlineWarning   false
 See codi::Config::IgnoreIntelNoInlineWarning.
 
#define CODI_IgnoreInvalidJacobians   false
 See codi::Config::IgnoreInvalidJacobians.
 
#define CODI_ImplicitConversion   false
 See codi::Config::ImplicitConversion.
 
#define CODI_ImplicitConversionWarning   true
 See codi::Config::ImplicitConversionWarning.
 
#define CODI_ImplicitTagConversion   false
 See codi::Config::ImplicitTagConversion.
 
#define CODI_OverflowCheck   true
 See codi::Config::OverflowCheck.
 
#define CODI_RemoveDuplicateJacobianArguments   0
 See codi::Config::RemoveDuplicateJacobianArguments.
 
#define CODI_ReversalZeroesAdjoints   true
 See codi::Config::ReversalZeroesAdjoints.
 
#define CODI_SkipZeroAdjointEvaluation   true
 See codi::Config::SkipZeroAdjointEvaluation.
 
#define CODI_SortIndicesOnReset   true
 See codi::Config::SortIndicesOnReset.
 
#define CODI_VariableAdjointInterfaceInPrimalTapes   0
 See codi::Config::VariableAdjointInterfaceInPrimalTapes.
 
bool constexpr codi::Config::CopyOptimization = true
 Do not store copy statements like a = b; if the identity handler allows it.
 
bool constexpr codi::Config::IgnoreIntelNoInlineWarning = false
 Disables warnings of the sort: warning #2196: routine is both "inline" and "noinline".
 
bool constexpr codi::Config::IgnoreInvalidJacobians = false
 Ignore invalid Jacobians like NaN or Inf.
 
bool constexpr codi::Config::ImplicitConversion = false
 
bool constexpr codi::Config::ImplicitConversionWarning = true
 Warn about implicit conversions in the code.
 
bool constexpr codi::Config::ImplicitTagConversion = false
 Enables the implicit conversion of tag data to its tag.
 
bool constexpr codi::Config::OverflowCheck = true
 Check in the index manager if an overflow occurred.
 
bool constexpr codi::Config::RemoveDuplicateJacobianArguments = 0
 Extra pass in Jacobian tapes that combines arguments with the same identifier.
 
bool constexpr codi::Config::ReversalZeroesAdjoints = true
 With a linear index management, control if adjoints are set to zero during reversal.
 
bool constexpr codi::Config::SkipZeroAdjointEvaluation = true
 Do not perform a reverse evaluation of a statement if the seeding adjoint is zero.
 
bool constexpr codi::Config::SortIndicesOnReset = true
 Reuse index tapes will sort their indices on a reset.
 
bool constexpr codi::Config::VariableAdjointInterfaceInPrimalTapes = 0
 Allow custom adjoint vector in primal values tapes.
 

Event system

bool constexpr codi::Config::ADWorkflowEvents = true
 Enable AD workflow events, also known as Tape* events. Enabled by default.
 
#define CODI_ADWorkflowEvents   true
 See codi::Config::ADWorkflowEvents.
 
#define CODI_IndexEvents   false
 See codi::Config::IndexEvents.
 
#define CODI_PreaccEvents   false
 See codi::Config::PreaccEvents.
 
#define CODI_StatementEvents   false
 See codi::Config::StatementEvents.
 
bool constexpr codi::Config::IndexEvents = false
 Enable index management events. Disabled by default.
 
bool constexpr codi::Config::PreaccEvents = false
 Enable preaccumulation events. Disabled by default.
 
bool constexpr codi::Config::StatementEvents = false
 Enable statement events. Disabled by default.
 

Relations to other libraries

#define CODI_EnableEnzyme   false
 See codi::Config::EnableEnzyme.
 
#define CODI_EnableMPI   false
 See codi::Config::EnableMPI.
 
#define CODI_EnableOpDiLib   false
 See codi::Config::EnableOpDiLib.
 
#define CODI_EnableOpenMP   false
 See codi::Config::EnableOpenMP.
 
bool constexpr codi::Config::EnableEigen = 1
 Enable Eigen specific implementations.
 
bool constexpr codi::Config::EnableEnzyme = false
 Add Enzyme specific functionality.
 
bool constexpr codi::Config::EnableMPI = false
 Add MPI and MeDiPack specific headers.
 
bool constexpr codi::Config::EnableOpDiLib = false
 Add OpDiLib specific headers. Requires codi::Config::EnableOpenMP == true.
 
bool constexpr codi::Config::EnableOpenMP = false
 Add OpenMP specific headers.
 

Macro definitions

bool constexpr codi::Config::AnnotateBranchLikelihood = __cplusplus >= 202002L
 Annotate branches with likely or unlikely, e.g., for if and else.
 
bool constexpr codi::Config::AvoidedInlines = 0
 Do not inline functions like evaluate().
 
#define CODI_AnnotateBranchLikelihood   CODI_HasCpp20
 See codi::Config::AnnotateBranchLikelihood.
 
#define CODI_EnableAssert   false
 See codi::Config::EnableAssert.
 
#define CODI_ForcedInlines   0
 See codi::Config::ForcedInlines.
 
#define CODI_FunctionAttributes   CODI_CUDAFunctionAttributes
 Attributes for all CoDiPack functions.
 
#define CODI_INLINE   CODI_FunctionAttributes inline
 See codi::Config::ForcedInlines.
 
#define CODI_INLINE_NO_FA   inline
 See codi::Config::ForcedInlines.
 
#define CODI_Likely   /* empty */
 Declare likely evaluation of an execution path.
 
#define CODI_NO_INLINE   /* no avoiding of inline defined */
 See codi::Config::AvoidedInlines.
 
#define CODI_Unlikely   /* empty */
 Declare unlikely evaluation of an execution path.
 
#define codiAssert(x)   /* disabled by CODI_EnableAssert */
 See codi::Config::EnableAssert.
 
bool constexpr codi::Config::EnableAssert = false
 Enables asserts in CoDiPack for consistency checking.
 
bool constexpr codi::Config::ForcedInlines = 0
 Force inlining instead of using the heuristics from the compiler.