Fix failures on R hub and Win builder. (#7763)

* Update date.
* Workaround amalgamation build with clang. (SimpleDMatrix instantiation)
* Workaround compiler error with driver push.
* Revert autoconf requirement.
* Fix model IO on 32-bit environment. (i386)
* Clarify the function name.
This commit is contained in:
Jiaming Yuan
2022-03-30 07:14:33 +08:00
committed by GitHub
parent a50b84244e
commit d4796482b5
7 changed files with 629 additions and 1188 deletions

View File

@@ -182,12 +182,12 @@ T BuiltinBSwap(T v) {
#endif // defined(__GLIBC__)
template <typename T, std::enable_if_t<sizeof(T) == 1>* = nullptr>
inline T ByteSwap(T v) {
inline T ToBigEndian(T v) {
return v;
}
template <typename T, std::enable_if_t<sizeof(T) != 1>* = nullptr>
inline T ByteSwap(T v) {
inline T ToBigEndian(T v) {
static_assert(std::is_pod<T>::value, "Only pod is supported.");
#if DMLC_LITTLE_ENDIAN
auto constexpr kS = sizeof(T);
@@ -217,7 +217,7 @@ class UBJReader : public JsonReader {
template <typename T>
T ReadPrimitive() {
auto v = ReadStream<T>();
v = ByteSwap(v);
v = ToBigEndian(v);
return v;
}