Merge pull request #14 from dmlc/hjk41

add kLongLong and kULongLong
This commit is contained in:
Tianqi Chen 2015-05-20 05:38:01 +02:00
commit 9520b90c4f
3 changed files with 14 additions and 2 deletions

View File

@ -183,7 +183,9 @@ enum DataType {
kLong = 4,
kULong = 5,
kFloat = 6,
kDouble = 7
kDouble = 7,
kLongLong = 8,
kULongLong = 9
};
} // namespace mpi
/*!

View File

@ -30,7 +30,7 @@ inline DataType GetType<int>(void) {
return kInt;
}
template<>
inline DataType GetType<unsigned>(void) {
inline DataType GetType<unsigned int>(void) {
return kUInt;
}
template<>
@ -49,6 +49,14 @@ template<>
inline DataType GetType<double>(void) {
return kDouble;
}
template<>
inline DataType GetType<long long>(void) {
return kLongLong;
}
template<>
inline DataType GetType<unsigned long long>(void) {
return kULongLong;
}
} // namespace mpi
} // namespace engine

View File

@ -110,6 +110,8 @@ inline MPI::Datatype GetType(mpi::DataType dtype) {
case kULong: return MPI::UNSIGNED_LONG;
case kFloat: return MPI::FLOAT;
case kDouble: return MPI::DOUBLE;
case kLongLong: return MPI::LONG_LONG;
case kULongLong: return MPI::UNSIGNED_LONG_LONG;
}
utils::Error("unknown mpi::DataType");
return MPI::CHAR;