diff --git a/cpp/open3d/pipelines/registration/Feature.cpp b/cpp/open3d/pipelines/registration/Feature.cpp index c4441a27005..2815159dcc4 100644 --- a/cpp/open3d/pipelines/registration/Feature.cpp +++ b/cpp/open3d/pipelines/registration/Feature.cpp @@ -154,9 +154,10 @@ CorrespondenceSet CorrespondencesFromFeatures(const Feature &source_features, std::vector corres(num_searches); const int kMaxThreads = utility::EstimateMaxThreads(); - const int kOuterThreads = std::min(kMaxThreads, num_searches); const int kInnerThreads = std::max(kMaxThreads / num_searches, 1); + (void)kOuterThreads; // Avoids compiler warning if OpenMP is disabled + (void)kInnerThreads; #pragma omp parallel for num_threads(kOuterThreads) for (int k = 0; k < num_searches; ++k) { geometry::KDTreeFlann kdtree(features[1 - k]); diff --git a/cpp/open3d/t/pipelines/registration/Feature.cpp b/cpp/open3d/t/pipelines/registration/Feature.cpp index 81ddfb87e13..d20e1a1b58c 100644 --- a/cpp/open3d/t/pipelines/registration/Feature.cpp +++ b/cpp/open3d/t/pipelines/registration/Feature.cpp @@ -102,6 +102,7 @@ core::Tensor CorrespondencesFromFeatures(const core::Tensor &source_features, const int kMaxThreads = utility::EstimateMaxThreads(); const int kOuterThreads = std::min(kMaxThreads, num_searches); + (void)kOuterThreads; // Avoids compiler warning if OpenMP is disabled // corres[0]: corres_ij, corres[1]: corres_ji #pragma omp parallel for num_threads(kOuterThreads)