Lazy initialization of device vector. (#5173)

* Lazy initialization of device vector.

* Fix #5162.

* Disable copy constructor of HostDeviceVector.  Prevents implicit copying.

* Fix CPU build.

* Bring back move assignment operator.
This commit is contained in:
Jiaming Yuan
2020-01-07 11:23:05 +08:00
committed by GitHub
parent 77cfbff5a7
commit ee287808fb
7 changed files with 114 additions and 64 deletions

View File

@@ -339,6 +339,7 @@ class GPUPredictor : public xgboost::Predictor {
// the first step only modifies prediction store in learner without following code.
InitOutPredictions(cache_emtry->second.data->Info(),
&(cache_emtry->second.predictions), model);
CHECK_EQ(cache_emtry->second.predictions.Size(), out_preds->Size());
cache_emtry->second.predictions.Copy(*out_preds);
}
}