python-torch/0001-include-fmt-ranges.h-for-using-fmt-join.patch
2024-07-16 08:02:17 +08:00

54 lines
1.8 KiB
Diff

From ba2cf11d1bf1dd5086c8e793198a697d4179cca7 Mon Sep 17 00:00:00 2001
From: Kefu Chai <tchaikov@gmail.com>
Date: Tue, 16 Jul 2024 08:00:22 +0800
Subject: [PATCH] include fmt/ranges.h for using fmt::join()
fmt::join() was moved into fmt/ranges.h in fmt 11, so include this
header for using it.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
torch/csrc/distributed/c10d/socket.cpp | 1 +
torch/csrc/profiler/standalone/execution_trace_observer.cpp | 1 +
torch/csrc/profiler/util.cpp | 1 +
3 files changed, 3 insertions(+)
diff --git a/torch/csrc/distributed/c10d/socket.cpp b/torch/csrc/distributed/c10d/socket.cpp
index 5013f2540..cbcd33a19 100644
--- a/torch/csrc/distributed/c10d/socket.cpp
+++ b/torch/csrc/distributed/c10d/socket.cpp
@@ -31,6 +31,7 @@ C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wdeprecated")
#include <fmt/chrono.h>
C10_DIAGNOSTIC_POP()
#include <fmt/format.h>
+#include <fmt/ranges.h>
#include <torch/csrc/distributed/c10d/error.h>
#include <torch/csrc/distributed/c10d/exception.h>
diff --git a/torch/csrc/profiler/standalone/execution_trace_observer.cpp b/torch/csrc/profiler/standalone/execution_trace_observer.cpp
index 2ef2e5423..fb053e916 100644
--- a/torch/csrc/profiler/standalone/execution_trace_observer.cpp
+++ b/torch/csrc/profiler/standalone/execution_trace_observer.cpp
@@ -10,6 +10,7 @@
#endif // _WIN32
#include <fmt/format.h>
+#include <fmt/ranges.h>
#include <chrono>
#include <cmath>
#include <fstream>
diff --git a/torch/csrc/profiler/util.cpp b/torch/csrc/profiler/util.cpp
index 896bf606c..c229ce130 100644
--- a/torch/csrc/profiler/util.cpp
+++ b/torch/csrc/profiler/util.cpp
@@ -5,6 +5,7 @@
#include <c10/util/ArrayRef.h>
#include <c10/util/irange.h>
#include <fmt/format.h>
+#include <fmt/ranges.h>
#ifdef USE_KINETO
#include <libkineto.h>
--
2.45.2