Make HostDeviceVector single gpu only (#4773)

* Make HostDeviceVector single gpu only
This commit is contained in:
Rong Ou
2019-08-25 14:51:13 -07:00
committed by Rory Mitchell
parent 41227d1933
commit 38ab79f889
54 changed files with 641 additions and 1621 deletions

View File

@@ -29,9 +29,9 @@
#endif
#if defined(__CUDACC__)
#define NGPUS 1
#define GPUIDX 0
#else
#define NGPUS 0
#define GPUIDX -1
#endif
bool FileExists(const std::string& filename);
@@ -189,11 +189,10 @@ std::unique_ptr<DMatrix> CreateSparsePageDMatrixWithRC(size_t n_rows, size_t n_c
gbm::GBTreeModel CreateTestModel();
inline GenericParameter CreateEmptyGenericParam(int gpu_id, int n_gpus) {
inline GenericParameter CreateEmptyGenericParam(int gpu_id) {
xgboost::GenericParameter tparam;
std::vector<std::pair<std::string, std::string>> args {
{"gpu_id", std::to_string(gpu_id)},
{"n_gpus", std::to_string(n_gpus)}};
{"gpu_id", std::to_string(gpu_id)}};
tparam.Init(args);
return tparam;
}