CppADCodeGen
HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
|
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 |
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 163 of file declare_cg.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 |
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.
|
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.
Referenced by CppAD::cg::AbstractCCompiler< Base >::compileSources().
|
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.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::setMultiThreading().
|
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.
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.
Referenced by CppAD::cg::ModelLibraryCSourceGen< Base >::setMultiThreading().
|
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.
|
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.
|
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().
|
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().
|
protectedinherited |
Whether or not to print progress information to the standard output
Definition at line 189 of file job_timer.hpp.