summarylogtreecommitdiffstats
path: root/clang.patch
blob: e1445eb36df226b803f91f1a36218d67526d3001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 =