summaryrefslogtreecommitdiff
path: root/dev-util/hip/files/hip-7.0.2-fix-libcxx-ranges.patch
blob: cbb6035d5df94eabeb434ad9fa81ca49d8fe21a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Defining __local before inclusion of libc++ <ranges> causes compilation errors.

Upstream PR: https://github.com/ROCm/rocm-systems/pull/1875
--- a/hipamd/include/hip/amd_detail/device_library_decls.h
+++ b/hipamd/include/hip/amd_detail/device_library_decls.h
@@ -120,6 +120,13 @@ extern "C" __device__ __hip_uint64_t __ockl_fprintf_append_string_n(__hip_uint64
                                                                     __hip_uint64_t length,
                                                                     __hip_uint32_t is_last);
 
+// libc++ <ranges> uses __local as function name; include one file, before defining __local macro
+#if defined(__cplusplus) && defined(_LIBCPP_VERSION) && defined(__has_include)
+#  if __has_include (<__ranges/join_view.h>)
+#    include <__ranges/join_view.h>
+#  endif
+#endif
+
 // Introduce local address space
 #define __local __attribute__((address_space(3)))