Remove column major specialization. (#5755)

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2020-06-05 16:19:14 +08:00
committed by GitHub
parent bd9d57f579
commit cacff9232a
10 changed files with 70 additions and 204 deletions

View File

@@ -149,7 +149,8 @@ TEST(CpuPredictor, InplacePredict) {
HostDeviceVector<float> data;
gen.GenerateDense(&data);
ASSERT_EQ(data.Size(), kRows * kCols);
data::DenseAdapter x{data.HostPointer(), kRows, kCols};
std::shared_ptr<data::DenseAdapter> x{
new data::DenseAdapter(data.HostPointer(), kRows, kCols)};
TestInplacePrediction(x, "cpu_predictor", kRows, kCols, -1);
}
@@ -158,8 +159,9 @@ TEST(CpuPredictor, InplacePredict) {
HostDeviceVector<bst_row_t> rptrs;
HostDeviceVector<bst_feature_t> columns;
gen.GenerateCSR(&data, &rptrs, &columns);
data::CSRAdapter x(rptrs.HostPointer(), columns.HostPointer(),
data.HostPointer(), kRows, data.Size(), kCols);
std::shared_ptr<data::CSRAdapter> x{new data::CSRAdapter(
rptrs.HostPointer(), columns.HostPointer(), data.HostPointer(), kRows,
data.Size(), kCols)};
TestInplacePrediction(x, "cpu_predictor", kRows, kCols, -1);
}
}

View File

@@ -129,7 +129,7 @@ TEST(GPUPredictor, InplacePredictCupy) {
gen.Device(0);
HostDeviceVector<float> data;
std::string interface_str = gen.GenerateArrayInterface(&data);
data::CupyAdapter x{interface_str};
auto x = std::make_shared<data::CupyAdapter>(interface_str);
TestInplacePrediction(x, "gpu_predictor", kRows, kCols, 0);
}
@@ -139,7 +139,7 @@ TEST(GPUPredictor, InplacePredictCuDF) {
gen.Device(0);
std::vector<HostDeviceVector<float>> storage(kCols);
auto interface_str = gen.GenerateColumnarArrayInterface(&storage);
data::CudfAdapter x {interface_str};
auto x = std::make_shared<data::CudfAdapter>(interface_str);
TestInplacePrediction(x, "gpu_predictor", kRows, kCols, 0);
}
@@ -154,7 +154,7 @@ TEST(GPUPredictor, MGPU_InplacePredict) { // NOLINT
gen.Device(1);
HostDeviceVector<float> data;
std::string interface_str = gen.GenerateArrayInterface(&data);
data::CupyAdapter x{interface_str};
auto x = std::make_shared<data::CupyAdapter>(interface_str);
TestInplacePrediction(x, "gpu_predictor", kRows, kCols, 1);
EXPECT_THROW(TestInplacePrediction(x, "gpu_predictor", kRows, kCols, 0),
dmlc::Error);