Reduce compiler warnings on CPU-only build. (#8483)

This commit is contained in:
Jiaming Yuan
2022-11-29 00:04:16 +08:00
committed by GitHub
parent d666ba775e
commit 3fc1046fd3
12 changed files with 69 additions and 83 deletions

View File

@@ -343,6 +343,7 @@ void GenericParameter::ConfigureGpuId(bool require_gpu) {
#else
// Just set it to CPU, don't think about it.
this->UpdateAllowUnknown(Args{{"gpu_id", std::to_string(kCpuId)}});
(void)(require_gpu);
#endif // defined(XGBOOST_USE_CUDA)
common::SetDevice(this->gpu_id);