commit | 5667505f3505738d3319c3a3067c847b864c96b8 | [log] [tgz] |
---|---|---|
author | Andrew Hunter <ahh@google.com> | Tue Oct 06 14:13:10 2015 -0700 |
committer | Keir Mierle <mierle@gmail.com> | Tue Dec 08 01:09:07 2015 +0000 |
tree | 1d83181e28d32972dd8c4d43bc22cd338a4bef64 | |
parent | 6418b33f21d3541f7a9678b29dacd53fcf58ab4f [diff] |
Align Jet matrices where supported We currently don't align the infinitesimal part of a Jet to a 16-byte boundary (and thus force Eigen to avoid using SSE ops)--as a member of a larger struct, we couldn't guarantee Jets would be allocated on appropriately-aligned boundaries. However, C++11 adds better support for requesting alignment: we can use it to guarantee the members will be properly aligned, and tell Eigen to vectorize. There is a significant gotcha here: the standard gives wide latitude to implementations as to which alignments they choose to support. If we ask for 16 and the system only supports 8, we may have misaligned Jets. So we test (using alignof(std::max_align_t)) that the current system supports 16-byte aligned values; if not, we fall back to the current solution. Two other small notes: - This is obviously gated on C++11 support, and thus we put the logic in port.h and export some useful #defines. - GCC 4.8.x has a bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56019) that has max_align_t in the wrong namespace. This will not be a problem with a modern GCC, but add a small workaround since many systems still ship 4.8. This results (on a x86 workstation) in a 60% speedup in Jacobian evaluation on bin/simple_bundle_adjuster problem-16-22106-pre.txt. Change-Id: I169b637a1e2a106956b536c41d6a514a266e7cc0
Please see ceres-solver.org for more information.
Ceres development happens on Gerrit, including both repository hosting and code reviews. The GitHub Repository is a continuously updated mirror which is primarily meant for issue tracking. Please see our Contributing to Ceres Guide for more details.
The upstream Gerrit repository is
https://ceres-solver.googlesource.com/ceres-solver