Skip to content

Commit 2712310

Browse files
committed
Update search to default to multithreaded.
1 parent eee3fe8 commit 2712310

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

search/include/pcl/search/search.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,15 @@ namespace pcl
396396
}
397397

398398
/** \brief Set the number of threads to use for searching over multiple points or indices
399-
* \param[in] nr_threads the number of threads to use (0 automatically sets the threads based on the hardware)
399+
* \param[in] num_threads the number of threads to use (0 automatically sets the threads based on the hardware)
400400
*/
401-
void setNumberOfThreads(unsigned int nr_threads) {
401+
void setNumberOfThreads(unsigned int num_threads) {
402402
#ifdef _OPENMP
403-
num_threads_ = nr_threads != 0 ? nr_threads : omp_get_num_procs();
403+
num_threads_ = num_threads != 0 ? num_threads : omp_get_num_procs();
404404
#else
405405
if (nr_threads != 1) {
406-
PCL_WARN("OpenMP is not available. Keeping number of threads unchanged at 1\n");
406+
PCL_WARN("OpenMP is not available. Setting number of threads to 1\n");
407+
num_threads_ = 1;
407408
}
408409
#endif
409410
}
@@ -418,7 +419,7 @@ namespace pcl
418419
std::string name_;
419420

420421
/** \brief The number of threads to use when searching over multiple points or indices */
421-
unsigned int num_threads_{1};
422+
unsigned int num_threads_{0};
422423

423424
private:
424425
struct Compare

0 commit comments

Comments
 (0)