Commit c7423338 authored by Vladyslav Usenko's avatar Vladyslav Usenko

Added camera mode benchmark

parent ce998f4d
Pipeline #55751965 passed with stage
in 2 minutes and 10 seconds
......@@ -18,6 +18,7 @@ compile:
- make -j4
- cd test/
- ctest -V
- ./benchmark_camera
- cd ../../
- mkdir build_coverage
- cd build_coverage
......
......@@ -10,3 +10,6 @@
[submodule "test/googletest"]
path = test/googletest
url = https://github.com/google/googletest.git
[submodule "test/benchmark"]
path = test/benchmark
url = https://github.com/google/benchmark.git
......@@ -8,12 +8,12 @@ set(GTEST_MAIN_LIBRARY gtest_main)
set(GTEST_LIBRARY gtest)
#set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "disable tests")
#set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "disable exceptions")
#set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "disable gtests")
#add_subdirectory(benchmark)
#include_directories(benchmark/include)
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "disable tests")
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "disable exceptions")
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "disable gtests")
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "disable install")
add_subdirectory(benchmark)
include_directories(benchmark/include)
include_directories(include)
......@@ -33,9 +33,8 @@ add_executable(test_preintegration src/test_preintegration.cpp)
target_link_libraries(test_preintegration ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} ${TBB_LIBRARIES})
# benchmarks
#add_executable(benchmark_camera src/benchmark_camera.cpp)
#target_link_libraries(benchmark_camera benchmark opengv)
add_executable(benchmark_camera src/benchmark_camera.cpp)
target_link_libraries(benchmark_camera benchmark)
enable_testing()
......
Subproject commit 30bd6ea7f8c678ec105a65add605a0c3c1107a44
#include <benchmark/benchmark.h>
#include <basalt/camera/camera_utils.hpp>
#include <basalt/camera/generic_camera.hpp>
template <class CamT>
void BM_Project(benchmark::State &state) {
......@@ -121,51 +121,33 @@ void BM_UnprojectJacobians(benchmark::State &state) {
}
}
// BENCHMARK_TEMPLATE(BM_Project, basalt::PinholeCamera<float>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::ExtendedUnifiedCamera<float>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::UnifiedCamera<float>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::EquidistantCamera<float>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::PinholeCamera<float>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians,
// basalt::ExtendedUnifiedCamera<float>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::UnifiedCamera<float>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::EquidistantCamera<float>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::ExtendedUnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::UnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::EquidistantCamera4<double>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::EquidistantCamera2<double>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::DoubleSphereCamera<double>);
// BENCHMARK_TEMPLATE(BM_Project, basalt::FovCamera<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::UnifiedCamera<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::KannalaBrandtCamera4<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::DoubleSphereCamera<double>);
BENCHMARK_TEMPLATE(BM_Project, basalt::FovCamera<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::ExtendedUnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::UnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::EquidistantCamera4<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::EquidistantCamera2<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::DoubleSphereCamera<double>);
// BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::FovCamera<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::UnifiedCamera<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::KannalaBrandtCamera4<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::DoubleSphereCamera<double>);
BENCHMARK_TEMPLATE(BM_ProjectJacobians, basalt::FovCamera<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::ExtendedUnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::UnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::EquidistantCamera4<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::EquidistantCamera2<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::DoubleSphereCamera<double>);
// BENCHMARK_TEMPLATE(BM_Unproject, basalt::FovCamera<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::UnifiedCamera<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::KannalaBrandtCamera4<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::DoubleSphereCamera<double>);
BENCHMARK_TEMPLATE(BM_Unproject, basalt::FovCamera<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::PinholeCamera<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians,
basalt::ExtendedUnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::UnifiedCamera<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians,
// basalt::EquidistantCamera4<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians,
// basalt::EquidistantCamera2<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians,
// basalt::DoubleSphereCamera<double>);
// BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::FovCamera<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::UnifiedCamera<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::KannalaBrandtCamera4<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::DoubleSphereCamera<double>);
BENCHMARK_TEMPLATE(BM_UnprojectJacobians, basalt::FovCamera<double>);
BENCHMARK_MAIN();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment