Offload some configurations into GBM. (#4553)
This is part 1 of refactoring configuration. * Move tree heuristic configurations. * Split up declarations and definitions for GBTree. * Implement UseGPU in gbm.
This commit is contained in:
@@ -37,6 +37,7 @@ GPUSet GPUSet::All(GpuIdType gpu_id, GpuIdType n_gpus, int32_t n_rows) {
|
||||
CHECK_GE(n_gpus, -1) << "n_gpus must be >= -1.";
|
||||
|
||||
GpuIdType const n_devices_visible = AllVisible().Size();
|
||||
CHECK_LE(n_gpus, n_devices_visible);
|
||||
if (n_devices_visible == 0 || n_gpus == 0 || n_rows == 0) {
|
||||
LOG(DEBUG) << "Runing on CPU.";
|
||||
return Empty();
|
||||
|
||||
@@ -360,7 +360,9 @@ struct HostDeviceVectorImpl {
|
||||
|
||||
void Shard(const GPUDistribution& distribution) {
|
||||
if (distribution_ == distribution) { return; }
|
||||
CHECK(distribution_.IsEmpty());
|
||||
CHECK(distribution_.IsEmpty())
|
||||
<< "This: " << distribution_.Devices().Size() << ", "
|
||||
<< "Others: " << distribution.Devices().Size();
|
||||
distribution_ = distribution;
|
||||
InitShards();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user