- 3.0.2 Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Optimize Execution Speed

Table of Contents

  • make use of Vectorization
  • use Auto-Differentiation with just-in-time compilation or code generation
  • if you do not want to use Auto-Diff, consider using the ct::rbd::RbdLinearizer for linearizing Rigid Body Dynamics
  • use multi-threading for Nonlinear Optimal Control Solvers
  • use HPIPM for running MPC or solving Optimal Control problems

Vectorization

Vectorization is a processor feature where a Single Instruction is applied to Multiple Data (SIMD). This is especially useful for linear algebra operations. CT relies on Eigen's Vectorization capabilities. This means CT supports SSE, FMA and AVX2 instructions.

Warning
Please study Eigen's documentation carefully. Especially the part about memory alignment

To enable vectorization in CT build it with vectorization flags. E.g. if you are on a fairly recent Intel CPU the following build command will enable vectorization

catkin build -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_FLAGS="-march=native -mtune=native -mavx2 -mfma"