Commit Graph

8 Commits

Author SHA1 Message Date
Sameer Agarwal ee35ef66f6 ClangFormat cleanup via scripts/all_format.sh
Change-Id: Ideafec543a9d090a767bae58123b7512c9e9ae4a
2022-03-12 16:25:45 -08:00
Sergiu Deitsch c14f360e63 Drop trivial special members
Do not define trivial constructors or destructors unless necessary
(e.g., for implementing pimpl) following the rule of zero. Define
virtual base class destructors out-of-line to avoid emitting vtables in
every translation unit.

Change-Id: Iea2d8978e62a8ee5a97b86cbb4e858d56e0fb274
2022-02-09 21:30:14 +01:00
Sergiu Deitsch a35bd1bf90 Use = default for trivial special members
Applied changes correspond to clang-tidy fixes
stemming from the modernize-use-equals-default check.

Change-Id: I254b0908a76d464131564b637cd0e42a6b03fb5a
2022-02-09 18:38:52 +01:00
Nikolaus Demmel 7b8f675bfd fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
  the space between two closing >> for nested templates. We don't
  choose c++14, because older versions of clang-format (version 9
  and earlier) don't know this value yet, and it doesn't make a
  difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
  (gtest/gmock)
- Add script to format all source files

Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
2020-09-21 02:52:07 +02:00
Alex Stewart 8c36bcc81f Use inline & -inlinehint-threshold in auto-diff benchmarks
- This results in the same performance as the original solution of
  increasing -inline-threshold, but this approach is more viable to
  incorporate in a large code base as its effects are more targeted.

Change-Id: Id798dbca7d3050de0ea847a5ecc69484ac78a2cf
2020-04-27 18:47:22 +01:00
Darius Rueckert 947ec0c1fa Remove AutodiffCodegen autodiff benchmarks
Change-Id: If1eaad31710cc91d40323ea6cae7cabe6fa64b1f
2020-04-02 13:53:20 +00:00
Sameer Agarwal f339d71dd6 Refactor the automatic differentiation benchmarks.
1. Merge them into a single binary.
2. All benchmarks now do the Residual and the Residual + Jacobian
evaluation.
3. Re-organize and simplify the CMake file in this directory.
4. Fix a bug in the file where the Clang compiler was not being matched.

autodiff_benchmarks
---------------------------------------------------------------------------
Benchmark                                 Time             CPU   Iterations
---------------------------------------------------------------------------
BM_Linear1CodeGen/0                    3.02 ns         3.01 ns    233870456
BM_Linear1CodeGen/1                    3.02 ns         3.01 ns    233059100
BM_Linear1AutoDiff/0                   3.78 ns         3.77 ns    185791712
BM_Linear1AutoDiff/1                   14.0 ns         13.8 ns     53927875
BM_Linear10CodeGen/0                   5.10 ns         5.10 ns    126745007
BM_Linear10CodeGen/1                   29.1 ns         29.1 ns     23949310
BM_Linear10AutoDiff/0                  6.50 ns         6.49 ns    107516972
BM_Linear10AutoDiff/1                   169 ns          169 ns      4153218
BM_Rat43AutoDiff/0                     52.7 ns         51.2 ns     16444586
BM_Rat43AutoDiff/1                     91.8 ns         91.5 ns      7302316
BM_SnavelyReprojectionCodeGen/0        38.0 ns         36.2 ns     21131501
BM_SnavelyReprojectionCodeGen/1         113 ns          112 ns      5627779
BM_SnavelyReprojectionAutoDiff/0       34.4 ns         34.3 ns     20476937
BM_SnavelyReprojectionAutoDiff/1        242 ns          240 ns      2930611
BM_BrdfCodeGen/0                       53.9 ns         53.7 ns     11950083
BM_BrdfCodeGen/1                        507 ns          505 ns      1396732
BM_BrdfAutoDiff/0                      58.3 ns         57.8 ns     12220670
BM_BrdfAutoDiff/1                      2034 ns         1999 ns       257003

autodiff_benchmarks_fast_math
---------------------------------------------------------------------------
Benchmark                                 Time             CPU   Iterations
---------------------------------------------------------------------------
BM_Linear1CodeGen/0                    3.19 ns         3.16 ns    215313065
BM_Linear1CodeGen/1                    2.78 ns         2.76 ns    201497994
BM_Linear1AutoDiff/0                   3.27 ns         3.26 ns    206154598
BM_Linear1AutoDiff/1                   13.2 ns         13.1 ns     57257840
BM_Linear10CodeGen/0                   5.70 ns         5.51 ns    121849325
BM_Linear10CodeGen/1                   33.9 ns         33.3 ns     21829295
BM_Linear10AutoDiff/0                  6.85 ns         6.78 ns    106813153
BM_Linear10AutoDiff/1                   173 ns          171 ns      3849877
BM_Rat43AutoDiff/0                     44.8 ns         44.2 ns     15577017
BM_Rat43AutoDiff/1                     96.2 ns         94.6 ns      7374864
BM_SnavelyReprojectionCodeGen/0        33.9 ns         33.5 ns     20508373
BM_SnavelyReprojectionCodeGen/1        89.7 ns         88.4 ns      7620624
BM_SnavelyReprojectionAutoDiff/0       36.5 ns         35.8 ns     20546176
BM_SnavelyReprojectionAutoDiff/1        257 ns          252 ns      3044325
BM_BrdfCodeGen/0                       61.1 ns         58.5 ns     11334013
BM_BrdfCodeGen/1                        265 ns          265 ns      2625459
BM_BrdfAutoDiff/0                      52.5 ns         52.5 ns     12938763
BM_BrdfAutoDiff/1                      1560 ns         1560 ns       440909

Change-Id: I2d1a4293d3245a50f73af6cf5e5138084321ae6f
2020-03-19 12:18:52 -07:00
Darius Rueckert 550766e6da Add Autodiff Brdf Benchmark
The disney brdf is a good benchmark cost functor, because it has
 - 28 parameters in 7 blocks
 - 3 residuals
 - Lots of low-level arithmetic

Change-Id: I62c8a717d0aecb64639158f971bdccf6afdfae36
2020-03-19 14:54:08 +01:00