cleanup tbb includes for deprecations

This commit is contained in:
Nikolaus Demmel 2020-06-23 16:58:33 +02:00
parent fa63b64c8a
commit cfb6fc5b6d
21 changed files with 28 additions and 40 deletions

View File

@ -209,6 +209,11 @@ endif()
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIR})
message(STATUS "TBB_INTERFACE_VERSION: ${TBB_INTERFACE_VERSION}")
if (TBB_INTERFACE_VERSION LESS 11004)
# enable global_control header for earlier TBB versions (Ubuntu 16.04, 18.04)
add_definitions(-DTBB_PREVIEW_GLOBAL_CONTROL)
endif()
find_package(OpenCV REQUIRED core imgproc calib3d highgui)
include_directories(${OpenCV_INCLUDE_DIR})

View File

@ -44,7 +44,7 @@
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
# This module defines
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
# TBB_INCLUDE_DIRS, where to find tbb_stddef.h, etc.
# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
# TBB_INSTALL_DIR, the base TBB install directory
@ -184,7 +184,7 @@ set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
# Jiri: tbbvars now sets the CPATH environment variable to the directory
# containing the headers.
find_path(TBB_INCLUDE_DIR
tbb/task_scheduler_init.h
tbb/tbb_stddef.h
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
)
mark_as_advanced(TBB_INCLUDE_DIR)

View File

@ -40,7 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/calibration/calibration.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
namespace basalt {

View File

@ -49,8 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/image/image_pyr.h>
#include <basalt/utils/keypoints.h>
#include <tbb/parallel_for.h>
namespace basalt {
template <typename Scalar, template <typename> typename Pattern>

View File

@ -40,8 +40,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/calibration/calibration.hpp>
#include <basalt/camera/stereographic_param.hpp>
#include <tbb/tbb.h>
namespace basalt {
template <typename Scalar>

View File

@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/optimization/accumulator.h>
#include <tbb/tbb.h>
#include <tbb/blocked_range.h>
namespace basalt {

View File

@ -38,6 +38,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/calibration/calibration_helper.h>
#include <basalt/optimization/poses_linearize.h>
#include <tbb/parallel_reduce.h>
namespace basalt {
class PosesOptimization {
@ -308,7 +310,6 @@ class PosesOptimization {
Eigen::aligned_vector<AprilgridCornersData> aprilgrid_corners_measurements;
Eigen::aligned_vector<Eigen::Vector4d> aprilgrid_corner_pos_3d;
}; // namespace basalt
};
} // namespace basalt

View File

@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/utils/test_utils.h>
#include <tbb/tbb.h>
#include <tbb/blocked_range.h>
#include <tbb/tbb_stddef.h>
namespace basalt {

View File

@ -45,6 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/serialization/headers_serialization.h>
#include <tbb/parallel_reduce.h>
#include <chrono>
namespace basalt {

View File

@ -35,14 +35,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/calibration/cam_calib.h>
#include <tbb/tbb.h>
#include <CLI/CLI.hpp>
int main(int argc, char **argv) {
tbb::task_scheduler_init init(
tbb::task_scheduler_init::default_num_threads());
std::string dataset_path;
std::string dataset_type;
std::string aprilgrid_path;

View File

@ -37,14 +37,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/calibration/cam_imu_calib.h>
#include <tbb/tbb.h>
#include <CLI/CLI.hpp>
int main(int argc, char **argv) {
tbb::task_scheduler_init init(
tbb::task_scheduler_init::default_num_threads());
std::string dataset_path;
std::string dataset_type;
std::string aprilgrid_path;

View File

@ -37,6 +37,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/utils/apriltag.h>
#include <tbb/parallel_for.h>
#include <opengv/absolute_pose/CentralAbsoluteAdapter.hpp>
#include <opengv/absolute_pose/methods.hpp>

View File

@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>

View File

@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>

View File

@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>

View File

@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>

View File

@ -42,8 +42,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <tbb/concurrent_queue.h>
#include <tbb/global_control.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>
@ -137,8 +137,11 @@ int main(int argc, char** argv) {
app.add_option("--num-threads", num_threads, "Number of threads.");
app.add_option("--step-by-step", step_by_step, "Path to config file.");
// global thread limit is in effect until global_control object is destroyed
std::unique_ptr<tbb::global_control> tbb_global_control;
if (num_threads > 0) {
tbb::task_scheduler_init init(num_threads);
tbb_global_control = std::make_unique<tbb::global_control>(
tbb::global_control::max_allowed_parallelism, num_threads);
}
try {

View File

@ -45,8 +45,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/utils/filesystem.h>
#include <basalt/calibration/calibration.hpp>
#include <tbb/tbb.h>
#include <CLI/CLI.hpp>
basalt::Calibration<double> calib;
@ -86,9 +84,6 @@ double compute_error(
}
int main(int argc, char **argv) {
tbb::task_scheduler_init init(
tbb::task_scheduler_init::default_num_threads());
std::string dataset_path;
std::string calibration_path;
std::string mocap_calibration_path;

View File

@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <tbb/global_control.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>
@ -222,8 +222,11 @@ int main(int argc, char** argv) {
"Save trajectory. Supported formats <tum, euroc, kitti>");
app.add_option("--use-imu", use_imu, "Use IMU.");
// global thread limit is in effect until global_control object is destroyed
std::unique_ptr<tbb::global_control> tbb_global_control;
if (num_threads > 0) {
tbb::task_scheduler_init init(num_threads);
tbb_global_control = std::make_unique<tbb::global_control>(
tbb::global_control::max_allowed_parallelism, num_threads);
}
try {

View File

@ -41,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sophus/se3.hpp>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/tbb.h>
#include <pangolin/display/image_view.h>
#include <pangolin/gl/gldraw.h>

View File

@ -1,5 +1,4 @@
#include <basalt/optimization/spline_optimize.h>
#include <iostream>
@ -8,9 +7,6 @@
#include "test_utils.h"
TEST(SplineOpt, SplineOptTest) {
tbb::task_scheduler_init init(
tbb::task_scheduler_init::default_num_threads());
int num_knots = 15;
basalt::CalibAccelBias<double> accel_bias_full;