Extensible binary serialization format for DMatrix::MetaInfo (#5187)
* Turn xgboost::DataType into C++11 enum class * New binary serialization format for DMatrix::MetaInfo * Fix clang-tidy * Fix c++ test * Implement new format proposal * Move helper functions to anonymous namespace; remove unneeded field * Fix lint * Add shape. * Keep only roundtrip test. * Fix test. * various fixes * Update data.cc Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
committed by
GitHub
parent
b4f952bd22
commit
44469a0ca9
@@ -26,7 +26,7 @@ namespace xgboost {
|
||||
class DMatrix;
|
||||
|
||||
/*! \brief data type accepted by xgboost interface */
|
||||
enum DataType {
|
||||
enum class DataType : uint8_t {
|
||||
kFloat32 = 1,
|
||||
kDouble = 2,
|
||||
kUInt32 = 3,
|
||||
@@ -38,6 +38,9 @@ enum DataType {
|
||||
*/
|
||||
class MetaInfo {
|
||||
public:
|
||||
/*! \brief number of data fields in MetaInfo */
|
||||
static constexpr uint64_t kNumField = 7;
|
||||
|
||||
/*! \brief number of rows in the data */
|
||||
uint64_t num_row_{0};
|
||||
/*! \brief number of columns in the data */
|
||||
|
||||
@@ -127,6 +127,8 @@ class HostDeviceVector {
|
||||
|
||||
void Resize(size_t new_size, T v = T());
|
||||
|
||||
using value_type = T;
|
||||
|
||||
private:
|
||||
HostDeviceVectorImpl<T>* impl_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user