Use ellpack for prediction only when sparsepage doesn't exist. (#5504)

This commit is contained in:
Jiaming Yuan
2020-04-10 12:15:46 +08:00
committed by GitHub
parent ad826e913f
commit 6671b42dd4
35 changed files with 166 additions and 116 deletions

17
tests/cpp/helpers.cu Normal file
View File

@@ -0,0 +1,17 @@
#include "helpers.h"
#include "../../src/data/device_adapter.cuh"
#include "../../src/data/device_dmatrix.h"
namespace xgboost {
std::shared_ptr<DMatrix> RandomDataGenerator::GenerateDeviceDMatrix(bool with_label,
bool float_label,
size_t classes) {
std::vector<HostDeviceVector<float>> storage(cols_);
std::string arr = this->GenerateColumnarArrayInterface(&storage);
auto adapter = data::CudfAdapter(arr);
std::shared_ptr<DMatrix> m {
new data::DeviceDMatrix{&adapter,
std::numeric_limits<float>::quiet_NaN(), 1, 256}};
return m;
}
} // namespace xgboost