Remove omp_get_max_threads in tree updaters. (#7590)
This commit is contained in:
@@ -302,22 +302,7 @@ class SparsePage {
|
||||
|
||||
SparsePage GetTranspose(int num_columns, int32_t n_threads) const;
|
||||
|
||||
void SortRows() {
|
||||
auto ncol = static_cast<bst_omp_uint>(this->Size());
|
||||
dmlc::OMPException exc;
|
||||
#pragma omp parallel for schedule(dynamic, 1)
|
||||
for (bst_omp_uint i = 0; i < ncol; ++i) {
|
||||
exc.Run([&]() {
|
||||
if (this->offset.HostVector()[i] < this->offset.HostVector()[i + 1]) {
|
||||
std::sort(
|
||||
this->data.HostVector().begin() + this->offset.HostVector()[i],
|
||||
this->data.HostVector().begin() + this->offset.HostVector()[i + 1],
|
||||
Entry::CmpValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
exc.Rethrow();
|
||||
}
|
||||
void SortRows(int32_t n_threads);
|
||||
|
||||
/**
|
||||
* \brief Pushes external data batch onto this page
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Copyright 2014-2019 by Contributors
|
||||
* Copyright 2014-2022 by XGBoost Contributors
|
||||
* \file tree_updater.h
|
||||
* \brief General primitive for tree learning,
|
||||
* Updating a collection of trees given the information.
|
||||
@@ -32,7 +32,7 @@ class Json;
|
||||
*/
|
||||
class TreeUpdater : public Configurable {
|
||||
protected:
|
||||
GenericParameter const* tparam_;
|
||||
GenericParameter const* ctx_;
|
||||
|
||||
public:
|
||||
/*! \brief virtual destructor */
|
||||
|
||||
Reference in New Issue
Block a user