Avoid calling CUDA code on CPU for linear model. (#7154)

This commit is contained in:
Jiaming Yuan
2021-09-01 10:45:31 +08:00
committed by GitHub
parent ba69244a94
commit 3a4f51f39f
4 changed files with 43 additions and 19 deletions

View File

@@ -28,12 +28,6 @@ DMLC_REGISTRY_FILE_TAG(updater_gpu_coordinate);
class GPUCoordinateUpdater : public LinearUpdater { // NOLINT
public:
~GPUCoordinateUpdater() { // NOLINT
if (learner_param_->gpu_id >= 0) {
dh::safe_cuda(cudaSetDevice(learner_param_->gpu_id));
}
}
// set training parameter
void Configure(Args const& args) override {
tparam_.UpdateAllowUnknown(args);