From 8a01218ccb17f59ff05f2baac1ef83609a13966c Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Tue, 1 Oct 2024 07:52:09 -0700 Subject: [PATCH] fixes --- ...ee_knn_classification_predict_dense_default_batch_impl.i | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/daal/src/algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_impl.i b/cpp/daal/src/algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_impl.i index d91494f9ec9..943ebba0fcc 100644 --- a/cpp/daal/src/algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_impl.i +++ b/cpp/daal/src/algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_impl.i @@ -24,8 +24,8 @@ #ifndef __KDTREE_KNN_CLASSIFICATION_PREDICT_DENSE_DEFAULT_BATCH_IMPL_I__ #define __KDTREE_KNN_CLASSIFICATION_PREDICT_DENSE_DEFAULT_BATCH_IMPL_I__ -#include "src/threading/threading.h" #include "services/daal_defines.h" +#include "src/threading/threading.h" #include "src/services/service_utils.h" #include "algorithms/algorithm.h" #include "services/daal_atomic_int.h" @@ -208,6 +208,8 @@ Status KNNClassificationPredictKernel::compu services::internal::TArrayScalable soa_arrays; bool isHomogenSOA = checkHomogenSOA(data, soa_arrays); + + services::Environment::getInstance()->setNumberOfThreads(1); daal::threader_for(blockCount, blockCount, [&](int iBlock) { Local * const local = localTLS.local(); DAAL_CHECK_MALLOC_THR(local); @@ -270,7 +272,7 @@ Status KNNClassificationPredictKernel::compu status = safeStat.detach(); if (!status) return status; - + services::Environment::getInstance()->setNumberOfThreads(nThreads); localTLS.reduce([&](Local * ptr) -> void { if (ptr) {