Remove accidental SparsePage copies (#3583)

This commit is contained in:
Rory Mitchell
2018-08-13 12:49:38 +12:00
committed by Philip Hyunsu Cho
parent 0b607fb884
commit 645996b12f
16 changed files with 28 additions and 28 deletions

View File

@@ -46,7 +46,7 @@ class BaseMaker: public TreeUpdater {
auto iter = p_fmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
for (bst_uint fid = 0; fid < batch.Size(); ++fid) {
auto c = batch[fid];
if (c.length != 0) {
@@ -305,7 +305,7 @@ class BaseMaker: public TreeUpdater {
this->GetSplitSet(nodes, tree, &fsplits);
auto iter = p_fmat->ColIterator();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
for (auto fid : fsplits) {
auto col = batch[fid];
const auto ndata = static_cast<bst_omp_uint>(col.length);

View File

@@ -731,7 +731,7 @@ class ColMaker: public TreeUpdater {
fsplits.resize(std::unique(fsplits.begin(), fsplits.end()) - fsplits.begin());
auto iter = p_fmat->ColIterator();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
for (auto fid : fsplits) {
auto col = batch[fid];
const auto ndata = static_cast<bst_omp_uint>(col.length);
@@ -862,7 +862,7 @@ class DistColMaker : public ColMaker {
}
auto iter = p_fmat->ColIterator();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
for (auto fid : fsplits) {
auto col = batch[fid];
const auto ndata = static_cast<bst_omp_uint>(col.length);

View File

@@ -666,7 +666,7 @@ class GPUMaker : public TreeUpdater {
auto iter = dmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
for (int i = 0; i < batch.Size(); i++) {
auto col = batch[i];
for (const Entry* it = col.data; it != col.data + col.length;

View File

@@ -347,7 +347,7 @@ class CQHistMaker: public HistMaker<TStats> {
auto iter = p_fmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
// start enumeration
const auto nsize = static_cast<bst_omp_uint>(fset.size());
#pragma omp parallel for schedule(dynamic, 1)
@@ -429,7 +429,7 @@ class CQHistMaker: public HistMaker<TStats> {
auto iter = p_fmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
// TWOPASS: use the real set + split set in the column iteration.
this->CorrectNonDefaultPositionByBatch(batch, fsplit_set_, tree);
@@ -717,7 +717,7 @@ class GlobalProposalHistMaker: public CQHistMaker<TStats> {
auto iter = p_fmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
// TWOPASS: use the real set + split set in the column iteration.
this->CorrectNonDefaultPositionByBatch(batch, this->fsplit_set_, tree);
@@ -775,7 +775,7 @@ class QuantileHistMaker: public HistMaker<TStats> {
auto iter = p_fmat->RowIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
// parallel convert to column major format
common::ParallelGroupBuilder<Entry>
builder(&col_ptr_, &col_data_, &thread_col_ptr_);

View File

@@ -60,7 +60,7 @@ class TreeRefresher: public TreeUpdater {
auto *iter = p_fmat->RowIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
CHECK_LT(batch.Size(), std::numeric_limits<unsigned>::max());
const auto nbatch = static_cast<bst_omp_uint>(batch.Size());
#pragma omp parallel for schedule(static)

View File

@@ -147,7 +147,7 @@ class SketchMaker: public BaseMaker {
auto iter = p_fmat->ColIterator();
iter->BeforeFirst();
while (iter->Next()) {
auto batch = iter->Value();
auto &batch = iter->Value();
// start enumeration
const auto nsize = static_cast<bst_omp_uint>(batch.Size());
#pragma omp parallel for schedule(dynamic, 1)