21 Commits

Author SHA1 Message Date
Sergiu Deitsch 0b03102b09 Add CMake feature and dependency summary
Use CMake's standard package discovery output and FeatureSummary instead
of custom status messages, so configuration reports package
availability, versions, and failure reasons consistently. Rename Ceres
feature controls to use the WITH_ prefix to group them consistently and
eliminate inconcistent naming. Remove retrospective cache updates so
package discovery preserves caller-provided values and avoids
unnecessary side effects.

Fixes #876

Change-Id: Ib6e40d56a0ea89b292fe34554777593ffda95f42
2026-08-10 00:51:27 +02:00
Sergiu Deitsch a2bab5af51 Fix ODR violations
Compiling Ceres with Schur specializations and Link Time Optimization
(LTO) results in warnings such as

    /usr/include/eigen3/Eigen/src/Core/ProductEvaluators.h:31:8: warning: type ‘struct evaluator’ violates the C++ One Definition Rule [-Wodr]
       31 | struct evaluator<Product<Lhs, Rhs, Options>> : public product_evaluator<Product<Lhs, Rhs, Options>> {
          |        ^

due to the redefinition of EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD which
alters internal Eigen class definitions and consequently results in ODR
violations.

Avoid the ODR violation by renaming the Eigen namespace in translation
units that redefine EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD.

While the issue is diagnosed in LTO builds of Ceres only, the problem
exists in non-LTO builds as well and per standard the compiler is not
even required to diagnose ODR issues. ODR violations constitute
undefined behavior.

Change-Id: Idf7c7a30cc8d3a86b0d62cbd33bef58783a62ee4
2026-02-17 10:14:21 -08:00
Sergiu Deitsch cd8c1074b2 Avoid GNU linker LTO warnings in Github workflows
Stop linker emitting warnings such as

  lto-wrapper: warning: using serial compilation of n LTRANS jobs

Change-Id: Ic933ef7b45955eabfa5b06e88cd195077ff9fc86
2025-02-17 17:09:13 -08:00
Sergiu Deitsch 539dffbec3 Use high-speed linker in Linux Github workflow
Using mold instead of GNU ld reduces the total build time by roughly
5-15 min. (depending on the load).

Change-Id: I66feab4e54c248cf92cc379d0085a93bdfdfef69
2025-02-17 17:08:02 -08:00
Sameer Agarwal ba6b678b23 Remove glog and gflags from the CI workflows
Change-Id: I94199ddcbd105b33a8401366dd0d952cc79ec755
2024-07-18 15:40:28 -07:00
Sergiu Deitsch 8ef35d0245 Fix CTest build config parameter
Change-Id: I4b7aed9c96c07a4e2b2b58618eb5a2452c845ae2
2024-07-10 00:17:45 +02:00
Mark Shachkov 6fb3dae4ee Add cuDSS as sparse Cholesky solver
cuDSS could be used as an alternative for SuiteSparse and EigenSparse
in case if CUDA capable GPU is available.

Change-Id: I7a567093ce91363478118153e181134ed5804573
2024-07-09 20:23:18 +02:00
Sergiu Deitsch e47a42c295 Fix MSVC builds and test runs
Change-Id: I79f839b22985a6510965559af54209d89c8703a0
2024-07-08 23:48:13 +02:00
Mark Shachkov 540b1f2f7a Checkout git submodules during github CI runs.
Change-Id: Ie4e2d618ee70035004ddcaa40a31725a6a610091
2024-07-07 23:22:53 +02:00
Sergiu Deitsch f8c2994dad Drop Ubuntu 20.04 and add Ubuntu 24.04 support
Change-Id: I34cb0032598c84820ead2cde8e0a083d82d0e1ce
2024-05-21 23:19:10 +02:00
Sergiu Deitsch 5de0fda0f2 Update Github actions
This avoids nodejs deprecation warnings.

Change-Id: I6f2c63332018c1483ad3c6d37e87970a4d557533
2024-05-21 23:04:32 +02:00
Dmitriy Korchemkin bdee4d6172 Block-sparse to CRS conversion using block-structure
Instead of pre-computing pemutation from block-sparse to CRS order,
index of value in CRS matrix is computed in the process of updating
values using block-sparse structure.

When it is possible to update values via a simple host-to-device copy,
block-sparse structure on GPU is discarded after computing CRS
structure.

Computing index is significantly slower than using pre-computed
permutation, but is still hidden by host-to-device transfer.

On problems from BAL dataset this results into reduction of extra
gpu memory consumption from 33% (permutation stored as 32-bit indices)
to ~10% for storing block-sparse structure.

Benchmark results:

======================= CUDA Device Properties ======================
Cuda version         : 11.8
Device ID            : 0
Device name          : NVIDIA GeForce RTX 2080 Ti
Total GPU memory     :  11012 MiB
GPU memory available :  10852 MiB
Compute capability   : 7.5
Warp size            : 32
Max threads per block: 1024
Max threads per dim  : 1024 1024 64
Max grid size        : 2147483647 65535 65535
Multiprocessor count : 68
====================================================================
Running ./bin/evaluation_benchmark
Run on (112 X 3200 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x56)
  L1 Instruction 32 KiB (x56)
  L2 Unified 1024 KiB (x56)
  L3 Unified 39424 KiB (x2)
Load Average: 24.58, 11.75, 8.52

-----------------------------------------------------------------------
Benchmark                                                          Time
-----------------------------------------------------------------------
Using on-the-fly computation of CRS index corresponding to block-sparse
index:

JacobianToCRS<g/final/problem-4585-1324582-pre.txt>             1607 ms
JacobianToCRSView<g/final/problem-4585-1324582-pre.txt>          564 ms
JacobianToCRSMatrix<g/final/problem-4585-1324582-pre.txt>       2226 ms
JacobianToCRSViewUpdate<g/final/problem-4585-1324582-pre.txt>    228 ms
JacobianToCRSMatrixUpdate<g/final/problem-4585-1324582-pre.txt>  400 ms

Using precomputed permutation:
JacobianToCRS</final/problem-4585-1324582-pre.txt>              1656 ms
JacobianToCRSView</final/problem-4585-1324582-pre.txt>           553 ms
JacobianToCRSMatrix</final/problem-4585-1324582-pre.txt>        2255 ms
JacobianToCRSViewUpdate</final/problem-4585-1324582-pre.txt>     228 ms
JacobianToCRSMatrixUpdate</final/problem-4585-1324582-pre.txt>   406 ms

Performance of JacobianToCRSViewUpdate is still limited by
host-to-device transfer, and JacobianToCRSView is faster than computing
CRS structure on CPU.

Change-Id: Ifb6910fb01ae6071400d36c277846fadc5857964
2023-05-26 01:12:47 +03:00
Dmitriy Korchemkin e7bd72d41e Permutation-based conversion from block-sparse to crs
Change-Id: Ic33a6476c033187dff61886deb6d1761524943f0
2023-05-12 03:33:25 +03:00
Sergiu Deitsch 1e2a24a8bd Update Github actions to avoid deprecation warnings
Change-Id: Ifc7b2b2337bbe03ce44649891830f78381b0749d
2023-01-04 17:05:49 +00:00
Dmitriy Korchemkin 2fd81de12d Add build configuration with CUDA on Linux
Change-Id: I3144a44692a7a129857b65ed84fb2a5637b25b5d
2022-11-29 18:51:13 +03:00
Sameer Agarwal 06bfe6ffac Remove OpenMP and No threading backends.
Since c++11, we can depend on C++ threads always being available.
With the recent work on the performance of CXX threading, the
additional complexity of maintaining multiple backends for some
minor performance delta is not worth it

https://github.com/ceres-solver/ceres-solver/issues/886

Change-Id: Idee480b22a498daec9c4366da8589aa58eaf36a1
2022-11-27 21:06:33 -08:00
Sergiu Deitsch 0c88301e66 Provide optional METIS support
* Split `CERES_NO_METIS` into two defines: `CERES_NO_PARTITION` and
  `CERES_NO_METIS`. The former refers to METIS support in SuiteSparse,
  the latter to the Eigen's MetisSupport module. This enables the use of
  sparse matrix reordering independent from SuiteSparse.
* Run Linux, macOS, and macOS Github workflows with METIS enabled
  SuiteSparse.

Fixes #808

Change-Id: I5076b7e1268d32cc3e7e56650edcbaf7fb3b59ce
2022-06-22 16:46:02 +00:00
Sergiu Deitsch d87fd551bc Fix Ubuntu 20.04 workflow tests
Previously, the tests did not run because the CMake version shipped with
Ubuntu 20.04 does not understand the `--test-dir` option and silently
fails.

Change-Id: I335e1d9e3890aa56e66a9dfd0fccd4594a84a08c
2022-05-27 10:47:07 +00:00
Sergiu Deitsch 464abc1983 Run Linux Github workflow on Ubuntu 22.04
Change-Id: I8a404c23d9f38bf9bd538edef933258814a91a67
2022-04-23 13:28:39 +02:00
Sergiu Deitsch 40c1a7e18e Fix Github workflows
* Ubuntu 18.04 GCC does not fully support C++17, hence remove the
  runner.
* Using CMake SuiteSparse in a C++17 project requires a workaround
  implemented in a recent release.

Change-Id: I9985fe12d582dfc9b74e97d670828334e507e9f5
2022-04-01 21:19:54 +02:00
Sergiu Deitsch 0133dada2d Add Github workflows
Change-Id: I74fc45784b1b1d20c22b9e983902aa69fbfa764f
2022-03-13 23:51:40 +01:00