// Copyright (c) 2019 by Contributors #include #include #include "../../../src/data/adapter.h" #include "../../../src/data/simple_dmatrix.h" #include "../../../src/common/timer.h" #include "../helpers.h" #include #include "../../../src/data/device_adapter.cuh" #include "test_array_interface.h" using namespace xgboost; // NOLINT void TestCudfAdapter() { constexpr size_t kRowsA {16}; constexpr size_t kRowsB {16}; std::vector columns; thrust::device_vector d_data_0(kRowsA); thrust::device_vector d_data_1(kRowsB); columns.emplace_back(GenerateDenseColumn("(" storage; auto str_arr = RandomDataGenerator{8192, n_features, 0.0} .Device(ctx.Device()) .GenerateArrayInterface(&storage); auto adapter = CupyAdapter{str_arr}; HostDeviceVector offset(adapter.NumRows() + 1, 0); offset.SetDevice(ctx.Device()); auto rstride = GetRowCounts(adapter.Value(), offset.DeviceSpan(), ctx.Device(), std::numeric_limits::quiet_NaN()); ASSERT_EQ(rstride, n_features); } } } // namespace xgboost::data