Use the new DeviceOrd in the linalg module. (#9527)

This commit is contained in:
Jiaming Yuan
2023-08-29 13:37:29 +08:00
committed by GitHub
parent 942b957eef
commit ddf2e68821
43 changed files with 252 additions and 273 deletions

View File

@@ -39,9 +39,9 @@ void TestGPUMakePair() {
auto make_args = [&](std::shared_ptr<ltr::RankingCache> p_cache, auto rank_idx,
common::Span<std::size_t const> y_sorted_idx) {
linalg::Vector<double> dummy;
auto d = dummy.View(ctx.gpu_id);
auto d = dummy.View(ctx.Device());
linalg::Vector<GradientPair> dgpair;
auto dg = dgpair.View(ctx.gpu_id);
auto dg = dgpair.View(ctx.Device());
cuda_impl::KernelInputs args{
d,
d,
@@ -50,9 +50,9 @@ void TestGPUMakePair() {
p_cache->DataGroupPtr(&ctx),
p_cache->CUDAThreadsGroupPtr(),
rank_idx,
info.labels.View(ctx.gpu_id),
info.labels.View(ctx.Device()),
predt.ConstDeviceSpan(),
linalg::MatrixView<GradientPair>{common::Span<GradientPair>{}, {0}, 0},
linalg::MatrixView<GradientPair>{common::Span<GradientPair>{}, {0}, DeviceOrd::CUDA(0)},
dg,
nullptr,
y_sorted_idx,