Replaced std::vector-based interfaces with HostDeviceVector-based interfaces. (#3116)

* Replaced std::vector-based interfaces with HostDeviceVector-based interfaces.

- replacement was performed in the learner, boosters, predictors,
  updaters, and objective functions
- only interfaces used in training were replaced;
  interfaces like PredictInstance() still use std::vector
- refactoring necessary for replacement of interfaces was also performed,
  such as using HostDeviceVector in prediction cache

* HostDeviceVector-based interfaces for custom objective function example plugin.
This commit is contained in:
Andrew V. Adinetz
2018-02-28 01:00:04 +01:00
committed by Rory Mitchell
parent 11bfa8584d
commit d5992dd881
38 changed files with 371 additions and 519 deletions

View File

@@ -25,17 +25,6 @@ ObjFunction* ObjFunction::Create(const std::string& name) {
return (e->body)();
}
void ObjFunction::GetGradient(HostDeviceVector<bst_float>* preds,
const MetaInfo& info,
int iteration,
HostDeviceVector<bst_gpair>* out_gpair) {
GetGradient(preds->data_h(), info, iteration, &out_gpair->data_h());
}
void ObjFunction::PredTransform(HostDeviceVector<bst_float> *io_preds) {
PredTransform(&io_preds->data_h());
}
} // namespace xgboost
namespace xgboost {