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;
70
70
template <typename PointNT> void
71
71
pcl::Poisson<PointNT>::setThreads (unsigned int num_threads)
72
72
{
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);
80
74
}
81
75
82
76
// ////////////////////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -219,8 +219,26 @@ namespace pcl
219
219
/* * \brief Set the number of threads to use.
220
220
* \param[in] threads the number of threads
221
221
*/
222
+ PCL_DEPRECATED (1 ,17 , " Use setNumberOfThreads() instead." )
222
223
void
223
224
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
+ }
224
242
225
243
226
244
/* * \brief Get the number of threads*/
You can’t perform that action at this time.
0 commit comments