Skip to content

Commit

Permalink
Remove unnecessary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jul 6, 2021
1 parent e5d01ad commit 462445c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/metric/rank_metric.cc
Expand Up @@ -112,7 +112,7 @@ struct EvalAMS : public Metric {
PredIndPairContainer rec(ndata);

const auto &h_preds = preds.ConstHostVector();
common::ParallelFor(ndata, this->tparam_->Threads(), [&](bst_omp_uint i) {
common::ParallelFor(ndata, [&](bst_omp_uint i) {
rec[i] = std::make_pair(h_preds[i], i);
});
XGBOOST_PARALLEL_SORT(rec.begin(), rec.end(), common::CmpFirst);
Expand Down
15 changes: 8 additions & 7 deletions src/tree/updater_colmaker.cc
Expand Up @@ -105,8 +105,10 @@ class ColMaker: public TreeUpdater {
interaction_constraints_.Configure(param_, dmat->Info().num_row_);
// build tree
for (auto tree : trees) {
Builder builder(param_, colmaker_param_, interaction_constraints_,
column_densities_, this->tparam_->Threads());
Builder builder(
param_,
colmaker_param_,
interaction_constraints_, column_densities_);
builder.Update(gpair->ConstHostVector(), dmat, tree);
}
param_.learning_rate = lr;
Expand Down Expand Up @@ -151,10 +153,9 @@ class ColMaker: public TreeUpdater {
explicit Builder(const TrainParam& param,
const ColMakerTrainParam& colmaker_train_param,
FeatureInteractionConstraintHost _interaction_constraints,
const std::vector<float> &column_densities,
int32_t n_threads)
const std::vector<float> &column_densities)
: param_(param), colmaker_train_param_{colmaker_train_param},
nthread_(n_threads),
nthread_(omp_get_max_threads()),
tree_evaluator_(param_, column_densities.size(), GenericParameter::kCpuId),
interaction_constraints_{std::move(_interaction_constraints)},
column_densities_(column_densities) {}
Expand Down Expand Up @@ -524,7 +525,7 @@ class ColMaker: public TreeUpdater {
// so that they are ignored in future statistics collection
const auto ndata = static_cast<bst_omp_uint>(p_fmat->Info().num_row_);

common::ParallelFor(ndata, nthread_, [&](bst_omp_uint ridx) {
common::ParallelFor(ndata, [&](bst_omp_uint ridx) {
CHECK_LT(ridx, position_.size())
<< "ridx exceed bound " << "ridx="<< ridx << " pos=" << position_.size();
const int nid = this->DecodePosition(ridx);
Expand Down Expand Up @@ -570,7 +571,7 @@ class ColMaker: public TreeUpdater {
for (auto fid : fsplits) {
auto col = page[fid];
const auto ndata = static_cast<bst_omp_uint>(col.size());
common::ParallelFor(ndata, this->nthread_, [&](bst_omp_uint j) {
common::ParallelFor(ndata, [&](bst_omp_uint j) {
const bst_uint ridx = col[j].index;
const int nid = this->DecodePosition(ridx);
const bst_float fvalue = col[j].fvalue;
Expand Down

0 comments on commit 462445c

Please sign in to comment.