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:
@@ -198,12 +198,12 @@ TEST(gpu_predictor, MGPU_Test) {
|
||||
std::vector<float>& gpu_out_predictions_h = gpu_out_predictions.HostVector();
|
||||
std::vector<float>& cpu_out_predictions_h = cpu_out_predictions.HostVector();
|
||||
float abs_tolerance = 0.001;
|
||||
for (int i = 0; i < gpu_out_predictions.Size(); i++) {
|
||||
ASSERT_NEAR(gpu_out_predictions_h[i], cpu_out_predictions_h[i], abs_tolerance);
|
||||
for (int j = 0; j < gpu_out_predictions.Size(); j++) {
|
||||
ASSERT_NEAR(gpu_out_predictions_h[j], cpu_out_predictions_h[j], abs_tolerance);
|
||||
}
|
||||
delete dmat;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace predictor
|
||||
} // namespace xgboost
|
||||
} // namespace xgboost
|
||||
Reference in New Issue
Block a user