File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
surface/include/pcl/surface Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,7 @@ pcl::Poisson<PointNT>::~Poisson () = default;
7070template <typename PointNT> void
7171pcl::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// ////////////////////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff 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*/
You can’t perform that action at this time.
0 commit comments