use ccQtHelpers::GetMaxThreadCount

This commit is contained in:
Paul Leroy
2024-02-13 09:22:50 +01:00
parent 858c04522a
commit 11ed7bd843
4 changed files with 18 additions and 7 deletions
+4 -1
View File
@@ -89,6 +89,9 @@ constexpr const char* LAS_FIELD_NAMES[22] = {"X",
//CCLib
#include <WeibullDistribution.h>
//CCPluginAPI
#include <ccQtHelpers.h>
//system
#include <assert.h>
@@ -424,7 +427,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints,
error.clear();
#ifndef _DEBUG
#if defined(_OPENMP)
#pragma omp parallel for num_threads(std::max(1, omp_get_max_threads() - 2))
#pragma omp parallel for num_threads(ccQtHelpers::GetMaxThreadCount(omp_get_max_threads()))
#endif
#endif
for (int i = 0; i < static_cast<int>(pointCount); ++i)