CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
|
#include <model_library_c_source_gen.hpp>
Public Member Functions | |
ModelLibraryCSourceGen (ModelCSourceGen< Base > &model) | |
template<class... Ms> | |
ModelLibraryCSourceGen (ModelCSourceGen< Base > &headModel, Ms &... rest) | |
ModelLibraryCSourceGen (const ModelLibraryCSourceGen &)=delete | |
ModelLibraryCSourceGen & | operator= (const ModelLibraryCSourceGen &)=delete |
void | addModel (ModelCSourceGen< Base > &model) |
const std::map< std::string, ModelCSourceGen< Base > * > & | getModels () const |
void | addCustomFunctionSource (const std::string &filename, const std::string &source) |
const std::map< std::string, std::string > & | getCustomSources () const |
MultiThreadingType | getMultiThreading () const |
void | setMultiThreading (MultiThreadingType multiThreading) |
void | saveSources (const std::string &sourcesFolder) |
virtual const std::map< std::string, std::string > & | getLibrarySources () |
bool | isVerbose () const |
void | setVerbose (bool verbose) |
size_t | getMaxLineWidth () const |
void | setMaxLineWidth (size_t width) |
size_t | getJobCount () const |
void | addListener (JobListener &l) |
bool | removeListener (JobListener &l) |
void | startingJob (const std::string &jobName, const JobType &type=JobTypeHolder<>::DEFAULT, const std::string &prefix="") |
void | finishedJob () |
Static Public Attributes | |
static const std::string | FUNCTION_VERSION = "cppad_cg_version" |
static const std::string | FUNCTION_MODELS = "cppad_cg_models" |
static const std::string | FUNCTION_ONCLOSE = "cppad_cg_on_close" |
static const std::string | FUNCTION_SETTHREADPOOLDISABLED = "cppad_cg_set_thread_pool_disabled" |
static const std::string | FUNCTION_ISTHREADPOOLDISABLED = "cppad_cg_is_thread_pool_disabled" |
static const std::string | FUNCTION_SETTHREADS = "cppad_cg_set_thread_number" |
static const std::string | FUNCTION_GETTHREADS = "cppad_cg_get_thread_number" |
static const std::string | FUNCTION_SETTHREADSCHEDULERSTRAT = "cppad_cg_thpool_set_scheduler_strategy" |
static const std::string | FUNCTION_GETTHREADSCHEDULERSTRAT = "cppad_cg_thpool_get_scheduler_strategy" |
static const std::string | FUNCTION_SETTHREADPOOLVERBOSE = "cppad_cg_thpool_set_verbose" |
static const std::string | FUNCTION_ISTHREADPOOLVERBOSE = "cppad_cg_thpool_is_verbose" |
static const std::string | FUNCTION_SETTHREADPOOLGUIDEDMAXGROUPWORK = "cppad_cg_thpool_set_guided_maxgroupwork" |
static const std::string | FUNCTION_GETTHREADPOOLGUIDEDMAXGROUPWORK = "cppad_cg_thpool_get_guided_maxgroupwork" |
static const std::string | FUNCTION_SETTHREADPOOLNUMBEROFTIMEMEAS = "cppad_cg_thpool_set_number_of_time_meas" |
static const std::string | FUNCTION_GETTHREADPOOLNUMBEROFTIMEMEAS = "cppad_cg_thpool_get_number_of_time_meas" |
static const unsigned long | API_VERSION = 7 |
static const JobType | DEFAULT |
static const JobType | LOOP_DETECTION |
static const JobType | GRAPH |
static const JobType | SOURCE_FOR_MODEL |
static const JobType | SOURCE_GENERATION |
static const JobType | COMPILING_FOR_MODEL |
static const JobType | COMPILING |
static const JobType | COMPILING_DYNAMIC_LIBRARY |
static const JobType | DYNAMIC_MODEL_LIBRARY |
static const JobType | STATIC_MODEL_LIBRARY |
static const JobType | ASSEMBLE_STATIC_LIBRARY |
static const JobType | JIT_MODEL_LIBRARY |
Protected Member Functions | |
virtual void | generateVersionSource (std::map< std::string, std::string > &sources) |
virtual void | generateModelsSource (std::map< std::string, std::string > &sources) |
virtual void | generateOnCloseSource (std::map< std::string, std::string > &sources) |
virtual void | generateThreadPoolSources (std::map< std::string, std::string > &sources) |
Static Protected Member Functions | |
static void | saveSources (const std::string &sourcesFolder, const std::map< std::string, std::string > &sources) |
Protected Attributes | |
std::map< std::string, ModelCSourceGen< Base > * > | _models |
std::map< std::string, std::string > | _customSource |
std::map< std::string, std::string > | _libSources |
MultiThreadingType | _multiThreading |
std::ostringstream | _cache |
bool | _verbose |
Static Protected Attributes | |
static const std::string | CONST = "const" |
Friends | |
class | ModelLibraryProcessor< Base > |
Generates C source code for a bundle of models.
Definition at line 28 of file model_library_c_source_gen.hpp.
|
inline |
Creates a new helper class for the generation of dynamic libraries using the C language.
model | A model compilation helper (must only be deleted after this object) |
Definition at line 80 of file model_library_c_source_gen.hpp.
|
inline |
Definition at line 89 of file model_library_c_source_gen.hpp.
|
inline |
Definition at line 121 of file model_library_c_source_gen.hpp.
|
inlineinherited |
Definition at line 252 of file job_timer.hpp.
|
inline |
Adds additional models to be compiled into the created library.
model | a model compilation helper (must only be deleted after this object) |
Definition at line 108 of file model_library_c_source_gen.hpp.
|
inlineinherited |
Definition at line 298 of file job_timer.hpp.
|
protectedvirtual |
Definition at line 147 of file model_library_c_source_gen_impl.hpp.
|
protectedvirtual |
Definition at line 169 of file model_library_c_source_gen_impl.hpp.
|
protectedvirtual |
Definition at line 194 of file model_library_c_source_gen_impl.hpp.
|
protectedvirtual |
Definition at line 137 of file model_library_c_source_gen_impl.hpp.
|
inline |
Provides the user defined custom sources.
Definition at line 133 of file model_library_c_source_gen.hpp.
|
inlineinherited |
Provides the number of currently running jobs
Definition at line 248 of file job_timer.hpp.
|
virtual |
Provides the sources for the model library level. These sources include, for instance, functions to retrieve the list of models contained in the library. This does not include the sources for the models.
Definition at line 106 of file model_library_c_source_gen_impl.hpp.
|
inlineinherited |
Definition at line 235 of file job_timer.hpp.
|
inline |
Definition at line 117 of file model_library_c_source_gen.hpp.
|
inline |
Defines whether or not to generate multithreading directives to parallelize the sparse Jacobian and sparse Hessian evaluation. Parallelization can be disabled locally for each model.
Definition at line 144 of file model_library_c_source_gen.hpp.
|
inlineinherited |
Definition at line 227 of file job_timer.hpp.
|
inlineinherited |
Definition at line 256 of file job_timer.hpp.
void CppAD::cg::ModelLibraryCSourceGen< Base >::saveSources | ( | const std::string & | sourcesFolder | ) |
Saves the generated C source code into several files.
sourcesFolder | A directory path where the files should be created (any existing files with the same names will be overridden). |
Definition at line 75 of file model_library_c_source_gen_impl.hpp.
|
staticprotected |
Definition at line 93 of file model_library_c_source_gen_impl.hpp.
|
inlineinherited |
Definition at line 239 of file job_timer.hpp.
|
inline |
Defines whether or not to generate multithreading directives to parallelize the sparse Jacobian and sparse Hessian evaluation. Parallelization can be disabled locally for each model. Do not forget to add the appropriate compiler and linker flags when multithreading is enabled.
multiThreading | multithreading support type |
Definition at line 157 of file model_library_c_source_gen.hpp.
|
inlineinherited |
Definition at line 231 of file job_timer.hpp.
|
inlineinherited |
Definition at line 260 of file job_timer.hpp.
|
friend |
Definition at line 189 of file model_library_c_source_gen.hpp.
|
protected |
temporary stream to generate source code
Definition at line 70 of file model_library_c_source_gen.hpp.
|
protected |
custom functions to be compiled in the dynamic library
Definition at line 56 of file model_library_c_source_gen.hpp.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::getCustomSources().
|
protected |
Library level generated source files
Definition at line 60 of file model_library_c_source_gen.hpp.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::addModel().
|
protected |
Models to be contained whithin the library
Definition at line 52 of file model_library_c_source_gen.hpp.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::addModel(), and CppAD::cg::ModelLibraryCSourceGen< Base >::ModelLibraryCSourceGen().
|
protected |
Parallelization type for the sparse Jacobian and sparse Hessian (experimental). Parallelization can be disabled locally for each model.
Definition at line 66 of file model_library_c_source_gen.hpp.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::getMultiThreading(), and CppAD::cg::ModelLibraryCSourceGen< Base >::setMultiThreading().
|
protectedinherited |
Whether or not to print progress information to the standard output
Definition at line 189 of file job_timer.hpp.
|
static |
Definition at line 45 of file model_library_c_source_gen.hpp.
|
staticinherited |
Definition at line 78 of file job_timer.hpp.
|
staticinherited |
Definition at line 74 of file job_timer.hpp.
|
staticinherited |
Definition at line 75 of file job_timer.hpp.
|
staticinherited |
Definition at line 73 of file job_timer.hpp.
|
staticprotected |
Definition at line 47 of file model_library_c_source_gen.hpp.
|
staticinherited |
Definition at line 68 of file job_timer.hpp.
|
staticinherited |
Definition at line 76 of file job_timer.hpp.
|
static |
Definition at line 42 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 44 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 36 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 38 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 34 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 40 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 31 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 32 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 33 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 41 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 43 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 39 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 35 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 37 of file model_library_c_source_gen.hpp.
|
static |
Definition at line 30 of file model_library_c_source_gen.hpp.
|
staticinherited |
Definition at line 70 of file job_timer.hpp.
|
staticinherited |
Definition at line 79 of file job_timer.hpp.
|
staticinherited |
Definition at line 69 of file job_timer.hpp.
|
staticinherited |
Definition at line 71 of file job_timer.hpp.
|
staticinherited |
Definition at line 72 of file job_timer.hpp.
|
staticinherited |
Definition at line 77 of file job_timer.hpp.