Remove omp_get_max_threads in data. (#7588)

This commit is contained in:
Jiaming Yuan
2022-01-24 02:44:07 +08:00
committed by GitHub
parent f84291c1e1
commit 5817840858
18 changed files with 97 additions and 92 deletions

View File

@@ -1,3 +1,6 @@
/*!
* Copyright 2019-2022 by XGBoost Contributors
*/
#include <gtest/gtest.h>
#include <dmlc/filesystem.h>
#include <fstream>
@@ -66,7 +69,7 @@ TEST(SparsePage, PushCSCAfterTranspose) {
SparsePage page; // Consolidated sparse page
for (const auto &batch : dmat->GetBatches<xgboost::SparsePage>()) {
// Transpose each batch and push
SparsePage tmp = batch.GetTranspose(ncols);
SparsePage tmp = batch.GetTranspose(ncols, common::OmpGetNumThreads(0));
page.PushCSC(tmp);
}

View File

@@ -1,5 +1,5 @@
/*!
* Copyright 2021 XGBoost contributors
* Copyright 2021-2022 XGBoost contributors
*/
#include <gtest/gtest.h>
#include <xgboost/data.h>
@@ -36,7 +36,7 @@ TEST(GradientIndex, FromCategoricalBasic) {
BatchParam p(0, max_bins);
GHistIndexMatrix gidx;
gidx.Init(m.get(), max_bins, false, {});
gidx.Init(m.get(), max_bins, false, common::OmpGetNumThreads(0), {});
auto x_copy = x;
std::sort(x_copy.begin(), x_copy.end());