Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Apr 15, 2024
1 parent 9566cd9 commit 209fd2a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions include/small_gicp/registration/reduction_omp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ParallelReductionOMP {
std::vector<double> 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<double, 6, 6> H;
Eigen::Matrix<double, 6, 1> b;
double e;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/small_gicp/util/downsampling_omp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ std::shared_ptr<OutputPointCloud> voxelgrid_sampling_omp(const InputPointCloud&

std::vector<std::pair<std::uint64_t, size_t>> 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;
Expand Down Expand Up @@ -61,7 +61,7 @@ std::shared_ptr<OutputPointCloud> 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<Eigen::Vector4d> sub_points;
sub_points.reserve(block_size);

Expand Down
4 changes: 2 additions & 2 deletions include/small_gicp/util/normal_estimation_omp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void estimate_local_features_omp(PointCloud& cloud, int num_neighbors, int num_t
traits::resize(cloud, traits::size(cloud));
UnsafeKdTree<PointCloud> 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<Setter>(cloud, kdtree, num_neighbors, i);
}
}
Expand All @@ -20,7 +20,7 @@ template <typename Setter, typename PointCloud, typename KdTree>
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<Setter>(cloud, kdtree, num_neighbors, i);
}
}
Expand Down

0 comments on commit 209fd2a

Please sign in to comment.