#include <importer.hpp>
Just-in-time compilation of code
- clang
- shell
Note: some of the plugins in this list might not be available on your system. Also, there might be extra plugins available to you that are not listed here. You can obtain their documentation with Importer.doc("myextraplugin")
Interface to the JIT compiler CLANG
Extra doc: https://github.com/casadi/casadi/wiki/L_21v
Id | Type | Description |
---|---|---|
flags | OT_STRINGVECTOR | Compile flags for the JIT compiler. Default: None |
include_path | OT_STRING | Include paths for the JIT compiler. The include directory shipped with CasADi will be automatically appended. |
Interface to the JIT compiler SHELL
Extra doc: https://github.com/casadi/casadi/wiki/L_22w
Id | Type | Description |
---|---|---|
cleanup | OT_BOOL | Cleanup temporary files when unloading. Default: true |
compiler | OT_STRING | Compiler command |
compiler_flags | OT_STRINGVECTOR | Alias for 'compiler_flags' |
compiler_output_flag | OT_STRING | Compiler flag to denote object output. Default: '-o ' |
compiler_setup | OT_STRING | Compiler setup command. Intended to be fixed. The 'flag' option is the prefered way to set custom flags. |
directory | OT_STRING | Directory to put temporary objects in. Must end with a file separator. |
extra_suffixes | OT_STRINGVECTOR | List of suffixes for extra files that the compiler may generate. Default: None |
flags | OT_STRINGVECTOR | Compile flags for the JIT compiler. Default: None |
linker | OT_STRING | Linker command |
linker_flags | OT_STRINGVECTOR | Linker flags for the JIT compiler. Default: None |
linker_output_flag | OT_STRING | Linker flag to denote shared library output. Default: '-o ' |
linker_setup | OT_STRING | Linker setup command. Intended to be fixed. The 'flag' option is the prefered way to set custom flags. |
name | OT_STRING | The file name used to write out compiled objects/libraries. The actual file names used depend on 'temp_suffix' and include extensions. Default: 'tmp_casadi_compiler_shell' |
temp_suffix | OT_BOOL | Use a temporary (seemingly random) filename suffix for file names. This is desired for thread-safety. This behaviour may defeat caching compiler wrappers. Default: true |
Extra doc: https://github.com/casadi/casadi/wiki/L_161
Definition at line 84 of file importer.hpp.
Public Types | |
using | internal_base_type = SharedObjectInternal |
using | base_type = SharedObject |
Public Member Functions | |
Importer () | |
Default constructor. More... | |
Importer (const std::string &name, const std::string &compiler, const Dict &opts=Dict()) | |
Importer factory. More... | |
ImporterInternal * | operator-> () |
Access functions of the node. More... | |
const ImporterInternal * | operator-> () const |
std::string | plugin_name () const |
Query plugin name. More... | |
bool | has_function (const std::string &symname) const |
signal_t | get_function (const std::string &symname) |
Get a function pointer for numerical evaluation. More... | |
bool | has_meta (const std::string &cmd, casadi_int ind=-1) const |
Does a meta entry exist? More... | |
std::string | get_meta (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a text. More... | |
bool | inlined (const std::string &symname) const |
Check if a function is inlined. More... | |
std::string | body (const std::string &symname) const |
Get the function body, if inlined. More... | |
std::string | library () const |
Get library name. More... | |
template<typename T > | |
T | to (const std::string &cmd, casadi_int ind=-1) const |
Convert to a type. More... | |
std::string | meta_string (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a string. More... | |
template<typename T > | |
std::vector< T > | meta_vector (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a vector. More... | |
template<typename T > | |
std::set< T > | meta_set (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a set. More... | |
casadi_int | meta_int (const std::string &cmd, casadi_int ind=-1) const |
Get entry as an integer. More... | |
void | serialize (SerializingStream &s) const |
Serialize an object. More... | |
std::string | class_name () const |
Get class name. More... | |
void | disp (std::ostream &stream, bool more=false) const |
Print a description of the object. More... | |
std::string | get_str (bool more=false) const |
Get string representation. More... | |
void | print_ptr (std::ostream &stream=casadi::uout()) const |
void | own (SharedObjectInternal *node) |
void | assign (SharedObjectInternal *node) |
Assign the node to a node class pointer without reference counting. More... | |
SharedObjectInternal * | get () const |
Get a const pointer to the node. More... | |
casadi_int | getCount () const |
Get the reference count. More... | |
void | swap (GenericShared &other) |
Swap content with another instance. More... | |
std::string | debug_repr () const |
bool | is_null () const |
Is a null pointer? More... | |
casadi_int | __hash__ () const |
Returns a number that is unique for a given Node. More... | |
GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
Get a weak reference to the object. More... | |
Static Public Member Functions | |
static std::string | type_name () |
Get type name. More... | |
static bool | test_cast (const SharedObjectInternal *ptr) |
Check if a particular cast is allowed. More... | |
static bool | has_plugin (const std::string &name) |
Check if a plugin is available. More... | |
static void | load_plugin (const std::string &name) |
Explicitly load a plugin dynamically. More... | |
static std::string | doc (const std::string &name) |
Get solver specific documentation. More... | |
static Importer | create (ImporterInternal *node) |
Create from node. More... | |
static Importer | create (ImporterInternal *node, const Dict &opts) |
Create from node and initialize. More... | |
static std::string | indexed (const std::string &cmd, casadi_int ind) |
static Importer | deserialize (DeserializingStream &s) |
Deserialize with type disambiguation. More... | |
Protected Member Functions | |
void | count_up () |
void | count_down () |
|
inherited |
Definition at line 103 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file shared_object.hpp.
casadi::Importer::Importer | ( | ) |
Definition at line 31 of file importer.cpp.
|
explicit |
Definition at line 34 of file importer.cpp.
References casadi::PluginInterface< ImporterInternal >::getPlugin(), and casadi::GenericShared< SharedObject, SharedObjectInternal >::own().
|
inherited |
If the Object does not point to any node, "0" is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_av
Definition at line 124 of file generic_shared_impl.hpp.
|
inherited |
improper use will cause memory leaks!
Extra doc: https://github.com/casadi/casadi/wiki/L_at
Definition at line 97 of file generic_shared_impl.hpp.
std::string casadi::Importer::body | ( | const std::string & | symname | ) | const |
Definition at line 95 of file importer.cpp.
Referenced by casadi::External::codegen_body().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_au
Definition at line 31 of file shared_object.cpp.
Referenced by casadi::FmuFunction::check_mem_count(), casadi::MXFunction::export_code_body(), and casadi::BlazingSplineFunction::merge().
|
protectedinherited |
Definition at line 134 of file generic_shared_impl.hpp.
|
protectedinherited |
Definition at line 133 of file generic_shared_impl.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_163
Definition at line 111 of file importer.cpp.
References casadi::GenericShared< Shared, Internal >::own().
Referenced by create(), and deserialize().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_164
Definition at line 117 of file importer.cpp.
References casadi::ImporterInternal::construct(), and create().
|
inherited |
Definition at line 113 of file generic_shared_impl.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_16d
Definition at line 107 of file importer.cpp.
References create(), and casadi::ImporterInternal::deserialize().
|
inherited |
Definition at line 35 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by casadi::Nlpsol::disp_more(), and casadi::CsparseInterface::nfact().
|
static |
Definition at line 67 of file importer.cpp.
References casadi::PluginInterface< ImporterInternal >::getPlugin().
|
inherited |
Definition at line 100 of file generic_shared_impl.hpp.
signal_t casadi::Importer::get_function | ( | const std::string & | symname | ) |
Definition at line 79 of file importer.cpp.
Referenced by casadi::external_transform(), casadi::FunctionInternal::finalize(), casadi::External::init_external(), casadi::GenericExternal::init_external(), and casadi::FmuInternal::load_function().
std::string casadi::Importer::get_meta | ( | const std::string & | cmd, |
casadi_int | ind = -1 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_166
Definition at line 87 of file importer.cpp.
|
inlineinherited |
Definition at line 91 of file shared_object.hpp.
|
inherited |
Definition at line 103 of file generic_shared_impl.hpp.
bool casadi::Importer::has_function | ( | const std::string & | symname | ) | const |
Definition at line 75 of file importer.cpp.
Referenced by casadi::External::factory(), casadi::External::has_forward(), casadi::External::has_jacobian(), casadi::External::has_reverse(), and casadi::External::init().
bool casadi::Importer::has_meta | ( | const std::string & | cmd, |
casadi_int | ind = -1 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_165
Definition at line 83 of file importer.cpp.
Referenced by casadi::GenericExternal::get_jac_sparsity(), casadi::External::get_n_in(), casadi::External::get_n_out(), casadi::External::get_name_in(), casadi::External::get_name_out(), casadi::GenericExternal::get_sparsity_in(), casadi::GenericExternal::get_sparsity_out(), casadi::GenericExternal::has_jac_sparsity(), and casadi::External::init().
|
static |
Definition at line 59 of file importer.cpp.
References casadi::PluginInterface< ImporterInternal >::has_plugin().
|
inlinestatic |
Convert indexed command
Definition at line 163 of file importer.hpp.
bool casadi::Importer::inlined | ( | const std::string & | symname | ) | const |
Definition at line 91 of file importer.cpp.
Referenced by casadi::External::codegen_body(), and casadi::External::codegen_declarations().
|
inherited |
Definition at line 117 of file generic_shared_impl.hpp.
std::string casadi::Importer::library | ( | ) | const |
Definition at line 99 of file importer.cpp.
Referenced by casadi::external(), casadi::External::External(), and casadi::FunctionInternal::serialize_body().
|
static |
Definition at line 63 of file importer.cpp.
References casadi::PluginInterface< ImporterInternal >::load_plugin().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_16b
Definition at line 203 of file importer.hpp.
Referenced by casadi::External::get_n_in(), and casadi::External::get_n_out().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_16a
Definition at line 196 of file importer.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_168
Definition at line 180 of file importer.hpp.
Referenced by casadi::External::get_name_in(), and casadi::External::get_name_out().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_169
Definition at line 188 of file importer.hpp.
Referenced by casadi::GenericExternal::get_jac_sparsity(), casadi::GenericExternal::get_sparsity_in(), casadi::GenericExternal::get_sparsity_out(), and casadi::External::init().
ImporterInternal * casadi::Importer::operator-> | ( | ) |
Definition at line 47 of file importer.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
const ImporterInternal * casadi::Importer::operator-> | ( | ) | const |
Definition at line 51 of file importer.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
|
inherited |
Assign the node to a node class pointer (or null)
Definition at line 90 of file generic_shared_impl.hpp.
std::string casadi::Importer::plugin_name | ( | ) | const |
Definition at line 71 of file importer.cpp.
|
inherited |
Print the pointer to the internal class
Definition at line 43 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
void casadi::Importer::serialize | ( | SerializingStream & | s | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_16c
Definition at line 103 of file importer.cpp.
|
inherited |
Definition at line 106 of file generic_shared_impl.hpp.
|
static |
Definition at line 55 of file importer.cpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_167
Definition at line 173 of file importer.hpp.
References casadi::T.
|
inlinestatic |
Extra doc: https://github.com/casadi/casadi/wiki/L_162
Definition at line 91 of file importer.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aw
Definition at line 131 of file generic_shared_impl.hpp.