From 209fd2abea5b2226f1d75143b35f805d6d4c0d4b Mon Sep 17 00:00:00 2001 From: "k.koide" Date: Mon, 15 Apr 2024 16:32:05 +0900 Subject: [PATCH] revert --- CMakeLists.txt | 2 +- include/small_gicp/registration/reduction_omp.hpp | 4 ++-- include/small_gicp/util/downsampling_omp.hpp | 4 ++-- include/small_gicp/util/normal_estimation_omp.hpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 454d87b..f1a039f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,7 +131,7 @@ if(BUILD_PYTHON_BINDINGS) find_package(Python COMPONENTS Interpreter Development) find_package(pybind11 CONFIG REQUIRED) - pybind11_add_module(small_gicp_python SHARED src/python/python.cpp) + pybind11_add_module(small_gicp_python src/python/python.cpp) set_target_properties(small_gicp_python PROPERTIES OUTPUT_NAME small_gicp) target_link_libraries(small_gicp_python PRIVATE small_gicp) endif() diff --git a/include/small_gicp/registration/reduction_omp.hpp b/include/small_gicp/registration/reduction_omp.hpp index 8c11267..d8a21bd 100644 --- a/include/small_gicp/registration/reduction_omp.hpp +++ b/include/small_gicp/registration/reduction_omp.hpp @@ -30,7 +30,7 @@ struct ParallelReductionOMP { std::vector es(num_threads, 0.0); #pragma omp parallel for num_threads(num_threads) schedule(guided, 8) - for (std::int64_t i = 0; i < factors.size(); i++) { + for (size_t i = 0; i < factors.size(); i++) { Eigen::Matrix H; Eigen::Matrix b; double e; @@ -59,7 +59,7 @@ struct ParallelReductionOMP { double sum_e = 0.0; #pragma omp parallel for num_threads(num_threads) schedule(guided, 8) reduction(+ : sum_e) - for (std::int64_t i = 0; i < factors.size(); i++) { + for (size_t i = 0; i < factors.size(); i++) { sum_e += factors[i].error(target, source, T); } return sum_e; diff --git a/include/small_gicp/util/downsampling_omp.hpp b/include/small_gicp/util/downsampling_omp.hpp index feac26c..de5d8fa 100644 --- a/include/small_gicp/util/downsampling_omp.hpp +++ b/include/small_gicp/util/downsampling_omp.hpp @@ -31,7 +31,7 @@ std::shared_ptr voxelgrid_sampling_omp(const InputPointCloud& std::vector> coord_pt(points.size()); #pragma omp parallel for num_threads(num_threads) schedule(guided, 32) - for (std::int64_t i = 0; i < traits::size(points); i++) { + for (size_t i = 0; i < traits::size(points); i++) { const Eigen::Array4i coord = fast_floor(traits::point(points, i) * inv_leaf_size) + coord_offset; if ((coord < 0).any() || (coord > coord_bit_mask).any()) { std::cerr << "warning: voxel coord is out of range!!" << std::endl; @@ -61,7 +61,7 @@ std::shared_ptr voxelgrid_sampling_omp(const InputPointCloud& std::atomic_uint64_t num_points = 0; #pragma omp parallel for num_threads(num_threads) schedule(guided, 4) - for (std::int64_t block_begin = 0; block_begin < traits::size(points); block_begin += block_size) { + for (size_t block_begin = 0; block_begin < traits::size(points); block_begin += block_size) { std::vector sub_points; sub_points.reserve(block_size); diff --git a/include/small_gicp/util/normal_estimation_omp.hpp b/include/small_gicp/util/normal_estimation_omp.hpp index 9b40f8e..df873b6 100644 --- a/include/small_gicp/util/normal_estimation_omp.hpp +++ b/include/small_gicp/util/normal_estimation_omp.hpp @@ -11,7 +11,7 @@ void estimate_local_features_omp(PointCloud& cloud, int num_neighbors, int num_t traits::resize(cloud, traits::size(cloud)); UnsafeKdTree kdtree(cloud); #pragma omp parallel for num_threads(num_threads) - for (std::int64_t i = 0; i < traits::size(cloud); i++) { + for (size_t i = 0; i < traits::size(cloud); i++) { estimate_local_features(cloud, kdtree, num_neighbors, i); } } @@ -20,7 +20,7 @@ template void estimate_local_features_omp(PointCloud& cloud, KdTree& kdtree, int num_neighbors, int num_threads) { traits::resize(cloud, traits::size(cloud)); #pragma omp parallel for num_threads(num_threads) - for (std::int64_t i = 0; i < traits::size(cloud); i++) { + for (size_t i = 0; i < traits::size(cloud); i++) { estimate_local_features(cloud, kdtree, num_neighbors, i); } }