| 358 | } |
| 359 | |
| 360 | void SimpleDMatrix::SaveToLocalFile(const std::string& fname) { |
| 361 | std::unique_ptr<dmlc::Stream> fo(dmlc::Stream::Create(fname.c_str(), "w")); |
| 362 | int tmagic = kMagic; |
| 363 | fo->Write(tmagic); |
| 364 | info_.SaveBinary(fo.get()); |
| 365 | fo->Write(sparse_page_->offset.HostVector()); |
| 366 | fo->Write(sparse_page_->data.HostVector()); |
| 367 | } |
| 368 | |
| 369 | #define INSTANTIATE_SDCTOR(__ADAPTER_T) \ |
| 370 | template SimpleDMatrix::SimpleDMatrix(__ADAPTER_T* adapter, float missing, std::int32_t nthread, \ |