Disable HT for DMatrix creation (#6386)

Co-authored-by: SHVETS, KIRILL <kirill.shvets@intel.com>
This commit is contained in:
ShvetsKS
2020-11-14 22:18:33 +08:00
committed by GitHub
co-authored by SHVETS, KIRILL
parent fcd6fad822
commit 512b464cfa
3 changed files with 12 additions and 2 deletions
+10
View File
@@ -160,6 +160,16 @@ inline int32_t OmpSetNumThreads(int32_t* p_threads) {
omp_set_num_threads(threads);
return nthread_original;
}
inline int32_t OmpSetNumThreadsWithoutHT(int32_t* p_threads) {
auto& threads = *p_threads;
int32_t nthread_original = omp_get_max_threads();
if (threads <= 0) {
threads = nthread_original;
}
omp_set_num_threads(threads);
return nthread_original;
}
} // namespace common
} // namespace xgboost