Reorder if-else statements to allow using of cpu branches for sycl-devices (#9682)

This commit is contained in:
Dmitry Razdoburdin
2023-10-18 04:55:33 +02:00
committed by GitHub
parent 4c0e4422d0
commit ea9f09716b
14 changed files with 99 additions and 98 deletions

View File

@@ -72,7 +72,7 @@ void FitStump(Context const* ctx, MetaInfo const& info, linalg::Matrix<GradientP
gpair.SetDevice(ctx->Device());
auto gpair_t = gpair.View(ctx->Device());
ctx->IsCPU() ? cpu_impl::FitStump(ctx, info, gpair_t, out->HostView())
: cuda_impl::FitStump(ctx, info, gpair_t, out->View(ctx->Device()));
ctx->IsCUDA() ? cuda_impl::FitStump(ctx, info, gpair_t, out->View(ctx->Device()))
: cpu_impl::FitStump(ctx, info, gpair_t, out->HostView());
}
} // namespace xgboost::tree