Files
eigen/benchmarks/Core/CMakeLists.txt
Rasmus Munk Larsen 8ddbe44799 Add small fixed-size matrix benchmarks for robotics/CV workloads
Benchmark the operations that dominate robotics and computer vision
inner loops: fixed-size matrix multiply, matrix-vector, inverse,
determinant, LLT, LDLT, PartialPivLU, ColPivHouseholderQR, JacobiSVD,
and SelfAdjointEigenSolver for sizes 2x2 through 8x9.

Key findings from the baseline measurements:
- MatMul/MatVec: excellent (<1ns for 3x3 float)
- Inverse 3x3: excellent (3.4ns)
- LLT 3x3→4x4: 8x jump (3.9→31.7ns float) due to inlining threshold
- ColPivQR 3x3: 166ns — expensive for such a small matrix
- JacobiSVD 3x3: 498ns double — the main CV bottleneck
- SelfAdjointEig: computeDirect() is 3.2x faster than iterative for 3x3
  (71ns vs 230ns) — many users may not know this API exists

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 15:06:32 -07:00

25 lines
1.4 KiB
CMake

eigen_add_benchmark(bench_gemm bench_gemm.cpp)
eigen_add_benchmark(bench_gemm_double bench_gemm.cpp DEFINITIONS SCALAR=double)
eigen_add_benchmark(bench_gemv bench_gemv.cpp)
eigen_add_benchmark(bench_vecadd bench_vecadd.cpp)
eigen_add_benchmark(bench_trsm bench_trsm.cpp)
eigen_add_benchmark(bench_reverse bench_reverse.cpp)
eigen_add_benchmark(bench_move_semantics bench_move_semantics.cpp)
eigen_add_benchmark(bench_reductions bench_reductions.cpp)
eigen_add_benchmark(bench_dot bench_dot.cpp)
eigen_add_benchmark(bench_cwise_math bench_cwise_math.cpp)
eigen_add_benchmark(bench_broadcasting bench_broadcasting.cpp)
eigen_add_benchmark(bench_block_ops bench_block_ops.cpp)
eigen_add_benchmark(bench_map bench_map.cpp)
eigen_add_benchmark(bench_diagonal bench_diagonal.cpp)
eigen_add_benchmark(bench_triangular_product bench_triangular_product.cpp)
eigen_add_benchmark(bench_selfadjoint_product bench_selfadjoint_product.cpp)
eigen_add_benchmark(bench_symv bench_symv.cpp)
eigen_add_benchmark(bench_trmv bench_trmv.cpp)
eigen_add_benchmark(bench_syr bench_syr.cpp)
eigen_add_benchmark(bench_syr2 bench_syr2.cpp)
eigen_add_benchmark(bench_construction bench_construction.cpp)
eigen_add_benchmark(bench_fixed_size bench_fixed_size.cpp)
eigen_add_benchmark(bench_fixed_size_double bench_fixed_size.cpp DEFINITIONS SCALAR=double)
eigen_add_benchmark(bench_small_matrix bench_small_matrix.cpp)