Simplify the data backends. (#5893)

This commit is contained in:
Jiaming Yuan
2020-07-16 15:17:31 +08:00
committed by GitHub
parent 7aee0e51ed
commit 029a8b533f
8 changed files with 790 additions and 806 deletions

View File

@@ -12,12 +12,16 @@ void DMatrixProxy::FromCudaColumnar(std::string interface_str) {
auto const& value = adapter->Value();
this->batch_ = adapter;
device_ = adapter->DeviceIdx();
this->Info().num_col_ = adapter->NumColumns();
this->Info().num_row_ = adapter->NumRows();
}
void DMatrixProxy::FromCudaArray(std::string interface_str) {
std::shared_ptr<CupyAdapter> adapter(new CupyAdapter(interface_str));
this->batch_ = adapter;
device_ = adapter->DeviceIdx();
this->Info().num_col_ = adapter->NumColumns();
this->Info().num_row_ = adapter->NumRows();
}
} // namespace data