From 8e8341a5fd15b06cf1c77baae8fb332353709aba Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 16 Jul 2024 17:41:50 +0800 Subject: [PATCH] [backport] Partial fix for CTK 12.5 (#10574) --- src/tree/updater_gpu_common.cuh | 21 ++++++++------------- src/tree/updater_gpu_hist.cu | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/tree/updater_gpu_common.cuh b/src/tree/updater_gpu_common.cuh index 1c3e6a55277d..5d999d6d6e01 100644 --- a/src/tree/updater_gpu_common.cuh +++ b/src/tree/updater_gpu_common.cuh @@ -1,18 +1,13 @@ -/*! - * Copyright 2017-2019 XGBoost contributors +/** + * Copyright 2017-2024, XGBoost contributors */ #pragma once -#include -#include -#include -#include -#include -#include -#include "../common/categorical.h" -#include "../common/device_helpers.cuh" -#include "../common/random.h" +#include // for numeric_limits +#include // for ostream + #include "gpu_hist/histogram.cuh" #include "param.h" +#include "xgboost/base.h" namespace xgboost::tree { struct GPUTrainingParam { @@ -54,8 +49,8 @@ enum DefaultDirection { }; struct DeviceSplitCandidate { - float loss_chg {-FLT_MAX}; - DefaultDirection dir {kLeftDir}; + float loss_chg{-std::numeric_limits::max()}; + DefaultDirection dir{kLeftDir}; int findex {-1}; float fvalue {0}; // categorical split, either it's the split category for OHE or the threshold for partition-based diff --git a/src/tree/updater_gpu_hist.cu b/src/tree/updater_gpu_hist.cu index 958fa0331569..e126aeb313df 100644 --- a/src/tree/updater_gpu_hist.cu +++ b/src/tree/updater_gpu_hist.cu @@ -19,6 +19,7 @@ #include "../common/cuda_context.cuh" // CUDAContext #include "../common/device_helpers.cuh" #include "../common/hist_util.h" +#include "../common/random.h" // for ColumnSampler, GlobalRandom #include "../common/timer.h" #include "../data/ellpack_page.cuh" #include "../data/ellpack_page.h"