Fix specifying gpu_id, add tests. (#3851)
* Rewrite gpu_id related code. * Remove normalised/unnormalised operatios. * Address difference between `Index' and `Device ID'. * Modify doc for `gpu_id'. * Better LOG for GPUSet. * Check specified n_gpus. * Remove inappropriate `device_idx' term. * Clarify GpuIdType and size_t.
This commit is contained in:
@@ -38,7 +38,7 @@ class HingeObj : public ObjFunction {
|
||||
void Configure(
|
||||
const std::vector<std::pair<std::string, std::string> > &args) override {
|
||||
param_.InitAllowUnknown(args);
|
||||
devices_ = GPUSet::All(param_.n_gpus).Normalised(param_.gpu_id);
|
||||
devices_ = GPUSet::All(param_.gpu_id, param_.n_gpus);
|
||||
label_correct_.Resize(devices_.IsEmpty() ? 1 : devices_.Size());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user