summarylogtreecommitdiffstats
path: root/clang.patch
diff options
context:
space:
mode:
Diffstat (limited to 'clang.patch')
-rw-r--r--clang.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/clang.patch b/clang.patch
new file mode 100644
index 000000000000..e1445eb36df2
--- /dev/null
+++ b/clang.patch
@@ -0,0 +1,40 @@
+diff --git a/onnxruntime/core/providers/cuda/reduction/reduction_functions.cc b/onnxruntime/core/providers/cuda/reduction/reduction_functions.cc
+index 955df6d9a..f9fd53e15 100644
+--- a/onnxruntime/core/providers/cuda/reduction/reduction_functions.cc
++++ b/onnxruntime/core/providers/cuda/reduction/reduction_functions.cc
+@@ -17,7 +17,7 @@ namespace cuda {
+
+ namespace {
+ // std::make_reverse_iterator is not implemented in older versions of GCC
+-#if !defined(__GNUC__) || __GNUC__ >= 5
++#if !defined(__GNUC__) || __GNUC__ >= 5 || defined(__clang__)
+ using std::make_reverse_iterator;
+ #else
+ template <typename It>
+@@ -39,7 +39,7 @@ optional<std::pair<int64_t, int64_t>> GetMinAndMaxContiguousAxes(
+ }
+
+ // normalize axis values and sort
+- const std::vector<int64_t> axes = [&original_axes, rank]() {
++ const std::vector<int64_t> axes = [&original_axes, rank]() -> std::vector<int64_t> {
+ std::vector<int64_t> result(original_axes);
+ std::for_each(
+ result.begin(), result.end(),
+@@ -73,7 +73,7 @@ optional<std::pair<int64_t, int64_t>> GetMinAndMaxContiguousAxes(
+ }
+
+ // expand axes over surrounding dimensions with value of 1
+- const int64_t min_axis = [&dims, &axes, &is_dim_one]() {
++ const int64_t min_axis = [&dims, &axes, &is_dim_one]() -> int64_t {
+ const auto& min_given_axis = axes.front();
+ // note that std::reverse_iterator(it) refers to the element at (it-1)
+ // it -> reverse it: element offset of -1
+@@ -85,7 +85,7 @@ optional<std::pair<int64_t, int64_t>> GetMinAndMaxContiguousAxes(
+ return std::distance(dims.begin(), before_min_axis_rit.base());
+ }();
+
+- const int64_t max_axis = [&dims, &axes, &is_dim_one]() {
++ const int64_t max_axis = [&dims, &axes, &is_dim_one]() -> int64_t {
+ const auto& max_given_axis = axes.back();
+ const auto after_max_given_axis_it = dims.begin() + max_given_axis + 1;
+ const auto after_max_axis_it =