Upgrade clang-tidy on CI. (#5469)
* Correct all clang-tidy errors. * Upgrade clang-tidy to 10 on CI. Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -67,7 +67,7 @@ TEST(Adapter, CSCAdapterColsMoreThanRows) {
|
||||
EXPECT_EQ(inst[3].index, 3);
|
||||
}
|
||||
|
||||
TEST(c_api, DMatrixSliceAdapterFromSimpleDMatrix) {
|
||||
TEST(CAPI, DMatrixSliceAdapterFromSimpleDMatrix) {
|
||||
auto p_dmat = RandomDataGenerator(6, 2, 1.0).GenerateDMatix();
|
||||
|
||||
std::vector<int> ridx_set = {1, 3, 5};
|
||||
|
||||
@@ -50,6 +50,6 @@ void TestCudfAdapter()
|
||||
});
|
||||
}
|
||||
|
||||
TEST(device_adapter, CudfAdapter) {
|
||||
TEST(DeviceAdapter, CudfAdapter) {
|
||||
TestCudfAdapter();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ TEST(DeviceDMatrix, RowMajor) {
|
||||
for(auto i = 0ull; i < x.size(); i++)
|
||||
{
|
||||
int column_idx = i % num_columns;
|
||||
EXPECT_EQ(impl->cuts_.SearchBin(x[i], column_idx), iterator[i]);
|
||||
EXPECT_EQ(impl->Cuts().SearchBin(x[i], column_idx), iterator[i]);
|
||||
}
|
||||
EXPECT_EQ(dmat.Info().num_col_, num_columns);
|
||||
EXPECT_EQ(dmat.Info().num_row_, num_rows);
|
||||
@@ -93,9 +93,9 @@ TEST(DeviceDMatrix, ColumnMajor) {
|
||||
for (auto i = 0ull; i < kRows; i++) {
|
||||
for (auto j = 0ull; j < columns.size(); j++) {
|
||||
if (j == 0) {
|
||||
EXPECT_EQ(iterator[i * 2 + j], impl->cuts_.SearchBin(d_data_0[i], j));
|
||||
EXPECT_EQ(iterator[i * 2 + j], impl->Cuts().SearchBin(d_data_0[i], j));
|
||||
} else {
|
||||
EXPECT_EQ(iterator[i * 2 + j], impl->cuts_.SearchBin(d_data_1[i], j));
|
||||
EXPECT_EQ(iterator[i * 2 + j], impl->Cuts().SearchBin(d_data_1[i], j));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ TEST(DeviceDMatrix, Equivalent) {
|
||||
const auto &device_dmat_batch =
|
||||
*device_dmat.GetBatches<EllpackPage>({0, num_bins}).begin();
|
||||
|
||||
ASSERT_EQ(batch.Impl()->cuts_.Values(), device_dmat_batch.Impl()->cuts_.Values());
|
||||
ASSERT_EQ(batch.Impl()->Cuts().Values(), device_dmat_batch.Impl()->Cuts().Values());
|
||||
ASSERT_EQ(batch.Impl()->gidx_buffer.HostVector(),
|
||||
device_dmat_batch.Impl()->gidx_buffer.HostVector());
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(EllpackPage, EmptyDMatrix) {
|
||||
auto& page = *dmat->GetBatches<EllpackPage>({0, kMaxBin}).begin();
|
||||
auto impl = page.Impl();
|
||||
ASSERT_EQ(impl->row_stride, 0);
|
||||
ASSERT_EQ(impl->cuts_.TotalBins(), 0);
|
||||
ASSERT_EQ(impl->Cuts().TotalBins(), 0);
|
||||
ASSERT_EQ(impl->gidx_buffer.Size(), 4);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ TEST(EllpackPage, Copy) {
|
||||
auto page = (*dmat->GetBatches<EllpackPage>(param).begin()).Impl();
|
||||
|
||||
// Create an empty result page.
|
||||
EllpackPageImpl result(0, page->cuts_, page->is_dense, page->row_stride,
|
||||
EllpackPageImpl result(0, page->Cuts(), page->is_dense, page->row_stride,
|
||||
kRows);
|
||||
|
||||
// Copy batch pages into the result page.
|
||||
@@ -152,7 +152,7 @@ TEST(EllpackPage, Compact) {
|
||||
auto page = (*dmat->GetBatches<EllpackPage>(param).begin()).Impl();
|
||||
|
||||
// Create an empty result page.
|
||||
EllpackPageImpl result(0, page->cuts_, page->is_dense, page->row_stride,
|
||||
EllpackPageImpl result(0, page->Cuts(), page->is_dense, page->row_stride,
|
||||
kCompactedRows);
|
||||
|
||||
// Compact batch pages into the result page.
|
||||
|
||||
@@ -63,14 +63,14 @@ TEST(SparsePageDMatrix, EllpackPageContent) {
|
||||
EXPECT_EQ(impl->n_rows, kRows);
|
||||
EXPECT_FALSE(impl->is_dense);
|
||||
EXPECT_EQ(impl->row_stride, 2);
|
||||
EXPECT_EQ(impl->cuts_.TotalBins(), 4);
|
||||
EXPECT_EQ(impl->Cuts().TotalBins(), 4);
|
||||
|
||||
auto impl_ext = (*dmat_ext->GetBatches<EllpackPage>(param).begin()).Impl();
|
||||
EXPECT_EQ(impl_ext->base_rowid, 0);
|
||||
EXPECT_EQ(impl_ext->n_rows, kRows);
|
||||
EXPECT_FALSE(impl_ext->is_dense);
|
||||
EXPECT_EQ(impl_ext->row_stride, 2);
|
||||
EXPECT_EQ(impl_ext->cuts_.TotalBins(), 4);
|
||||
EXPECT_EQ(impl_ext->Cuts().TotalBins(), 4);
|
||||
|
||||
std::vector<common::CompressedByteT> buffer(impl->gidx_buffer.HostVector());
|
||||
std::vector<common::CompressedByteT> buffer_ext(impl_ext->gidx_buffer.HostVector());
|
||||
@@ -149,7 +149,6 @@ TEST(SparsePageDMatrix, EllpackPageMultipleLoops) {
|
||||
dmat_ext(CreateSparsePageDMatrixWithRC(kRows, kCols, kPageSize, true, tmpdir));
|
||||
|
||||
BatchParam param{0, kMaxBins, kPageSize};
|
||||
auto impl = (*dmat->GetBatches<EllpackPage>(param).begin()).Impl();
|
||||
|
||||
size_t current_row = 0;
|
||||
for (auto& page : dmat_ext->GetBatches<EllpackPage>(param)) {
|
||||
|
||||
Reference in New Issue
Block a user