Skip to content

Commit be689c7

Browse files
committed
Rename setThreads to setNumberOfThreads.
1 parent e9783c4 commit be689c7

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

surface/include/pcl/surface/impl/poisson.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,7 @@ pcl::Poisson<PointNT>::~Poisson () = default;
7070
template <typename PointNT> void
7171
pcl::Poisson<PointNT>::setThreads (unsigned int num_threads)
7272
{
73-
#ifdef _OPENMP
74-
num_threads_ = num_threads != 0 ? num_threads : omp_get_num_procs();
75-
#else
76-
if (num_threads_ != 1) {
77-
PCL_WARN("OpenMP is not available. Keeping number of threads unchanged at 1\n");
78-
}
79-
#endif
73+
setNumberOfThreads(num_threads);
8074
}
8175

8276
//////////////////////////////////////////////////////////////////////////////////////////////

surface/include/pcl/surface/poisson.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,26 @@ namespace pcl
219219
/** \brief Set the number of threads to use.
220220
* \param[in] threads the number of threads
221221
*/
222+
PCL_DEPRECATED(1,17, "Use setNumberOfThreads() instead.")
222223
void
223224
setThreads(unsigned int num_threads = 0);
225+
226+
/** \brief Initialize the scheduler and set the number of threads to use.
227+
* \param num_threads the number of hardware threads to use (0 sets the value back
228+
* to automatic)
229+
*/
230+
inline void
231+
setNumberOfThreads(unsigned int num_threads = 0)
232+
{
233+
#ifdef _OPENMP
234+
num_threads_ = num_threads != 0 ? num_threads : omp_get_num_procs();
235+
#else
236+
if (num_threads_ != 1) {
237+
PCL_WARN(
238+
"OpenMP is not available. Keeping number of threads unchanged at 1\n");
239+
}
240+
#endif
241+
}
224242

225243

226244
/** \brief Get the number of threads*/

0 commit comments

Comments
 (0)