From a2489ece93e300ef5ad5f121729802aec93b5d0e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 15 Feb 2022 10:19:19 +0100 Subject: [PATCH] default nThreads depends on the machine used --- .../filter_screened_poisson/filter_screened_poisson.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index 71f1f90bd..c992484d1 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -30,6 +30,8 @@ #include #include +#include + #include "filter_screened_poisson.h" #include "poisson_utils.h" @@ -214,6 +216,8 @@ RichParameterList FilterScreenedPoissonPlugin::initParameterList( const MeshModel&) { RichParameterList parlist; + unsigned int nThreads = std::thread::hardware_concurrency(); + if (nThreads == 0) nThreads = 8; if (ID(filter) == FP_SCREENED_POISSON) { parlist.addParam(RichBool("visibleLayer", false, "Merge all visible layers", "Enabling this flag means that all the visible layers will be used for providing the points.")); parlist.addParam(RichInt("depth", 8, "Reconstruction Depth", "This integer is the maximum depth of the tree that will be used for surface reconstruction. Running at depth d corresponds to solving on a voxel grid whose resolution is no larger than 2^d x 2^d x 2^d. Note that since the reconstructor adapts the octree to the sampling density, the specified reconstruction depth is only an upper bound. The default value for this parameter is 8.")); @@ -225,7 +229,7 @@ RichParameterList FilterScreenedPoissonPlugin::initParameterList( parlist.addParam(RichInt("iters", 8, "Gauss-Seidel Relaxations", "This integer value specifies the number of Gauss-Seidel relaxations to be performed at each level of the hierarchy. The default value for this parameter is 8.", true)); parlist.addParam(RichBool("confidence", false, "Confidence Flag", "Enabling this flag tells the reconstructor to use the quality as confidence information; this is done by scaling the unit normals with the quality values. When the flag is not enabled, all normals are normalized to have unit-length prior to reconstruction.")); parlist.addParam(RichBool("preClean", false, "Pre-Clean", "Enabling this flag force a cleaning pre-pass on the data removing all unreferenced vertices or vertices with null normals.")); - parlist.addParam(RichInt("threads", 8, "Number Threads", "Maximum number of threads that the reconstruction algorithm can use.")); + parlist.addParam(RichInt("threads", nThreads, "Number Threads", "Maximum number of threads that the reconstruction algorithm can use.")); } return parlist; }