apply workarounds for (probably bogus) warnings or errors from nvcc
This commit is contained in:
@ -480,11 +480,23 @@ constexpr FMT_ALWAYS_INLINE const char* narrow(const char* s) { return s; }
|
||||
template <typename Char>
|
||||
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, std::size_t n)
|
||||
-> int {
|
||||
// LAMMPS customization. Try to suppress warnings from nvcc
|
||||
#if 0 // original code
|
||||
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
|
||||
for (; n != 0; ++s1, ++s2, --n) {
|
||||
if (*s1 < *s2) return -1;
|
||||
if (*s1 > *s2) return 1;
|
||||
}
|
||||
#else
|
||||
if (!is_constant_evaluated() && sizeof(Char) == 1) {
|
||||
return memcmp(s1, s2, n);
|
||||
} else {
|
||||
for (; n != 0; ++s1, ++s2, --n) {
|
||||
if (*s1 < *s2) return -1;
|
||||
if (*s1 > *s2) return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -2591,7 +2591,9 @@ class bigint {
|
||||
}
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR bigint() : exp_(0) {}
|
||||
// LAMMPS customization. NVCC wrongly complains about calling a non-constepr function
|
||||
// so we comment out constexpr here for now.
|
||||
/* FMT_CONSTEXPR */ bigint() : exp_(0) {}
|
||||
explicit bigint(uint64_t n) { assign(n); }
|
||||
|
||||
bigint(const bigint&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user