From 7c22f22a6e60bc6977197651e425224db8687dad Mon Sep 17 00:00:00 2001 From: Dmitry Razdoburdin <> Date: Mon, 25 Nov 2024 04:56:12 -0800 Subject: [PATCH] fix merge --- src/objective/regression_obj.cu | 1 + tests/cpp/objective/test_regression_obj.cc | 2 ++ tests/cpp/objective/test_regression_obj_cpu.cc | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/objective/regression_obj.cu b/src/objective/regression_obj.cu index 9106044fcded..7346385e79cc 100644 --- a/src/objective/regression_obj.cu +++ b/src/objective/regression_obj.cu @@ -121,6 +121,7 @@ class RegLossObj : public FitInterceptGlmLike { if (iter == 0) { ValidateLabel(info); } + size_t const ndata = preds.Size(); out_gpair->SetDevice(ctx_->Device()); auto device = ctx_->Device(); diff --git a/tests/cpp/objective/test_regression_obj.cc b/tests/cpp/objective/test_regression_obj.cc index 9664aa0456d7..f9d6c67004ed 100644 --- a/tests/cpp/objective/test_regression_obj.cc +++ b/tests/cpp/objective/test_regression_obj.cc @@ -6,6 +6,8 @@ #include #include +#include // for iota + #include "../../../src/common/linalg_op.h" // for begin, end #include "../../../src/objective/adaptive.h" #include "../../../src/tree/param.h" // for TrainParam diff --git a/tests/cpp/objective/test_regression_obj_cpu.cc b/tests/cpp/objective/test_regression_obj_cpu.cc index 0359067825df..5fc94f897e9d 100644 --- a/tests/cpp/objective/test_regression_obj_cpu.cc +++ b/tests/cpp/objective/test_regression_obj_cpu.cc @@ -5,8 +5,6 @@ #include #include -#include // for iota - #include "../../../src/objective/adaptive.h" #include "../../../src/tree/param.h" // for TrainParam #include "../helpers.h"