Browse Source

abseil-cpp-tstring: Remove custom patches for building against old cuda versions
7dac9bf355791b665f26cb14953523df159183a3

thegeorg 1 year ago
parent
commit
1337adc744

+ 1 - 1
contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h

@@ -159,7 +159,7 @@ template <
 #endif  // !Y_ABSL_HAVE_BUILTIN(__builtin_bit_cast)
                             ,
                             int>::type = 0>
-#if Y_ABSL_HAVE_BUILTIN(__builtin_bit_cast) && (!defined(__CUDACC__) || CUDA_VERSION >= 11010)
+#if Y_ABSL_HAVE_BUILTIN(__builtin_bit_cast)
 inline constexpr Dest bit_cast(const Source& source) {
   return __builtin_bit_cast(Dest, source);
 }

+ 2 - 4
contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h

@@ -602,8 +602,6 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
 // Checks whether C++17 std::string_view is available.
 #ifdef Y_ABSL_HAVE_STD_STRING_VIEW
 #error "Y_ABSL_HAVE_STD_STRING_VIEW cannot be directly set."
-#elif defined(__NVCC__)
-#define Y_ABSL_HAVE_STD_STRING_VIEW 1
 #elif defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
 #define Y_ABSL_HAVE_STD_STRING_VIEW 1
 #elif defined(Y_ABSL_INTERNAL_CPLUSPLUS_LANG) && \
@@ -977,9 +975,9 @@ static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
 #ifdef Y_ABSL_HAVE_CONSTANT_EVALUATED
 #error Y_ABSL_HAVE_CONSTANT_EVALUATED cannot be directly set
 #endif
-#if defined(__cpp_lib_is_constant_evaluated) && (!defined(__CUDACC__) || CUDA_VERSION >= 11000)
+#ifdef __cpp_lib_is_constant_evaluated
 #define Y_ABSL_HAVE_CONSTANT_EVALUATED 1
-#elif Y_ABSL_HAVE_BUILTIN(__builtin_is_constant_evaluated) && (!defined(__CUDACC__) || CUDA_VERSION >= 11000)
+#elif Y_ABSL_HAVE_BUILTIN(__builtin_is_constant_evaluated)
 #define Y_ABSL_HAVE_CONSTANT_EVALUATED 1
 #endif
 

+ 12 - 14
contrib/restricted/abseil-cpp-tstring/y_absl/strings/str_cat.h

@@ -567,7 +567,6 @@ StrAppend(y_absl::Nonnull<String*> result, T i) {
 // handled quickly.
 // Later we can look into how we can extend this to more general argument
 // mixtures without bloating codegen too much, or copying unnecessarily.
-#ifndef __NVCC__
 template <typename String, typename... T>
 std::enable_if_t<
     (sizeof...(T) > 1),
@@ -605,20 +604,19 @@ StrAppend(y_absl::Nonnull<String*> str, T... args) {
   ptrdiff_t n;   // The length of the current argument
   typename String::pointer pos = &(*str)[old_size];
   using SomeTrivialEmptyType = std::false_type;
-  // Ugly code due to the lack of C++14 fold expression makes us.
-  const SomeTrivialEmptyType dummy1;
-  for (const SomeTrivialEmptyType& dummy2 :
-       {(/* Comma expressions are poor man's C++17 fold expression for C++14 */
-         (void)(n = lengths[i]),
-         (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0),
-         (void)y_absl::numbers_internal::FastIntToBufferBackward(
-             y_absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)),
-             pos += n, static_cast<uint32_t>(n)),
-         (void)++i, dummy1)...}) {
-    (void)dummy2;  // Remove & migrate to fold expressions in C++17
-  }
+  const SomeTrivialEmptyType dummy;
+  // Ugly code due to the lack of C++17 fold expressions
+  const SomeTrivialEmptyType dummies[] = {
+      (/* Comma expressions are poor man's C++17 fold expression for C++14 */
+       (void)(n = lengths[i]),
+       (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0),
+       (void)y_absl::numbers_internal::FastIntToBufferBackward(
+           y_absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)),
+           pos += n, static_cast<uint32_t>(n)),
+       (void)++i, dummy)...};
+  (void)dummies;  // Remove & migrate to fold expressions in C++17
 }
-#endif
+
 // Helper function for the future StrCat default floating-point format, %.6g
 // This is fast.
 inline strings_internal::AlphaNumBuffer<