Unify test helpers for creating ctx. (#9274)

This commit is contained in:
Jiaming Yuan
2023-06-10 03:35:22 +08:00
committed by GitHub
parent ea0deeca68
commit 152e2fb072
36 changed files with 161 additions and 169 deletions

View File

@@ -37,10 +37,10 @@ void TestPredictionFromGradientIndex(std::string name, size_t rows, size_t cols,
constexpr size_t kClasses { 3 };
LearnerModelParam mparam{MakeMP(cols, .5, kClasses)};
auto lparam = CreateEmptyGenericParam(0);
auto cuda_ctx = MakeCUDACtx(0);
std::unique_ptr<Predictor> predictor =
std::unique_ptr<Predictor>(Predictor::Create(name, &lparam));
std::unique_ptr<Predictor>(Predictor::Create(name, &cuda_ctx));
predictor->Configure({});
Context ctx;