-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): torch 1.8 with cuda 11.3 string_view patch
- Loading branch information
1 parent
2526892
commit 5002308
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/c10/util/string_view.h b/c10/util/string_view.h | ||
index 2958887afc..140521553e 100644 | ||
--- a/c10/util/string_view.h | ||
+++ b/c10/util/string_view.h | ||
@@ -581,7 +581,7 @@ class basic_string_view final { | ||
constexpr bool equals_(basic_string_view rhs) const { | ||
// We don't use string_view::compare() here but implement it manually because | ||
// only looking at equality allows for more optimized code. | ||
-#if defined(__GNUC__) | ||
+#if defined(__GNUC__) && !defined(__CUDACC__) | ||
return size() == rhs.size() && 0 == __builtin_memcmp(data(), rhs.data(), size()); | ||
#elif __cpp_constexpr >= 201304 | ||
// if we are in C++14, write it iteratively. This is faster than the recursive C++11 implementation below. |