Skip to content

Commit

Permalink
Switch to using tbb::parallel_reduce on all platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbs4261 committed Sep 17, 2024
1 parent bba01ef commit ec98cae
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions cpp/open3d/t/pipelines/kernel/RegistrationCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,12 @@ static void ComputePoseDopplerICPKernelCPU(
// and 28th as inlier_count.
std::vector<scalar_t> A_1x29(29, 0.0);

#ifdef _WIN32
std::vector<scalar_t> zeros_29(29, 0.0);
A_1x29 = tbb::parallel_reduce(
tbb::blocked_range<int>(0, n), zeros_29,
[&](tbb::blocked_range<int> r, std::vector<scalar_t> A_reduction) {
for (int workload_idx = r.begin(); workload_idx < r.end();
++workload_idx) {
#else
scalar_t *A_reduction = A_1x29.data();
#pragma omp parallel for reduction(+ : A_reduction[:29]) schedule(static) num_threads(utility::EstimateMaxThreads())
for (int workload_idx = 0; workload_idx < n; ++workload_idx) {
#endif
scalar_t J_G[6] = {0}, J_D[6] = {0};
scalar_t r_G = 0, r_D = 0;

Expand Down Expand Up @@ -306,7 +300,6 @@ static void ComputePoseDopplerICPKernelCPU(
A_reduction[28] += 1;
}
}
#ifdef _WIN32
return A_reduction;
},
// TBB: Defining reduction operation.
Expand All @@ -317,7 +310,6 @@ static void ComputePoseDopplerICPKernelCPU(
}
return result;
});
#endif

for (int i = 0; i < 29; ++i) {
global_sum[i] = A_1x29[i];
Expand Down

0 comments on commit ec98cae

Please sign in to comment.