Skip to content

Commit

Permalink
avoid unrecognized-pragma errors when fmt headers are compiled by C/C…
Browse files Browse the repository at this point in the history
…++ compilers (only want this for nvcc)
  • Loading branch information
jameslamb committed Sep 17, 2024
1 parent e34bb8c commit ad0e899
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rapids-cmake/cpm/patches/fmt/fix_11_0_2_unreachable_loop.diff
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 62764942..b61c2776 100644
index 62764942..60f7483b 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -464,6 +464,7 @@ template <typename Char> FMT_CONSTEXPR auto length(const Char* s) -> size_t {
@@ -464,6 +464,9 @@ template <typename Char> FMT_CONSTEXPR auto length(const Char* s) -> size_t {
return len;
}

+#if defined(__NVCC__)
+#pragma nv_diag_suppress 128
+#endif
template <typename Char>
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, std::size_t n)
-> int {
@@ -474,6 +475,7 @@ FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, std::size_t n)
@@ -474,6 +477,9 @@ FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, std::size_t n)
}
return 0;
}
+#if defined(__NVCC__)
+#pragma nv_diag_default 128
+#endif

namespace adl {
using namespace std;

0 comments on commit ad0e899

Please sign in to comment.