tests/cpp: Add tests for SparsePageDMatrix

The SparsePageDMatrix or external memory DMatrix reads data from the
file IO rather than load it into RAM.
This commit is contained in:
AbdealiJK
2016-12-03 12:38:52 +05:30
committed by Tianqi Chen
parent c3629c91d3
commit d6407c3746
3 changed files with 105 additions and 0 deletions

View File

@@ -4,6 +4,11 @@ std::string TempFileName() {
return std::tmpnam(nullptr);
}
bool FileExists(const std::string name) {
struct stat st;
return stat(name.c_str(), &st) == 0;
}
long GetFileSize(const std::string filename) {
struct stat st;
stat(filename.c_str(), &st);