Refactor DeviceUVector. (#10595)

Create a wrapper instead of using inheritance to avoid inconsistent interface of the class.
This commit is contained in:
Jiaming Yuan
2024-07-18 03:33:01 +08:00
committed by GitHub
parent 07732e02e5
commit e9fbce9791
4 changed files with 59 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ TEST(DeviceUVector, Basic) {
std::int32_t verbosity{3};
std::swap(verbosity, xgboost::GlobalConfigThreadLocalStore::Get()->verbosity);
DeviceUVector<float> uvec;
uvec.Resize(12);
uvec.resize(12);
auto peak = GlobalMemoryLogger().PeakMemory();
auto n_bytes = sizeof(decltype(uvec)::value_type) * uvec.size();
ASSERT_EQ(peak, n_bytes);