-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathfix-cuda-12-rocm-libraries.patch
More file actions
129 lines (107 loc) · 5.37 KB
/
fix-cuda-12-rocm-libraries.patch
File metadata and controls
129 lines (107 loc) · 5.37 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
diff --git a/projects/hipcub/CMakeLists.txt b/projects/hipcub/CMakeLists.txt
index fbcecf0fc4..0fbae70749 100644
--- a/projects/hipcub/CMakeLists.txt
+++ b/projects/hipcub/CMakeLists.txt
@@ -174,7 +174,7 @@ math(EXPR hipcub_VERSION_NUMBER "${hipcub_VERSION_MAJOR} * 100000 + ${hipcub_VER
include(VerifyCompiler)
# Get dependencies (except rocm-cmake, included earlier)
-include(Dependencies)
+# include(Dependencies)
if(BUILD_ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address -shared-libasan)
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_for.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_for.hpp
index 0f22c40517..31fab88dd6 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_for.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_for.hpp
@@ -30,6 +30,7 @@
#define HIPCUB_CUB_DEVICE_DEVICE_FOR_HPP_
#include "../../../config.hpp"
+#if CUDA_VERSION >= 12060
#include <cub/device/device_for.cuh> // IWYU pragma: export
@@ -194,4 +195,5 @@ HIPCUB_RUNTIME_FUNCTION
END_HIPCUB_NAMESPACE
+#endif
#endif // HIPCUB_CUB_DEVICE_DEVICE_FOR_HPP_
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_merge.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_merge.hpp
index f314f5a128..e22f08fba9 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_merge.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_merge.hpp
@@ -30,6 +30,7 @@
#define HIPCUB_CUB_DEVICE_DEVICE_MERGE_HPP_
#include "../../../config.hpp"
+#if CUDA_VERSION >= 12080
#include <cub/device/device_merge.cuh> // IWYU pragma: export
@@ -104,4 +105,5 @@ struct DeviceMerge
END_HIPCUB_NAMESPACE
+#endif
#endif // HIPCUB_CUB_DEVICE_DEVICE_MERGE_HPP_
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_scan.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_scan.hpp
index 72ad11f7bc..038fddccdd 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_scan.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_scan.hpp
@@ -182,6 +182,7 @@ public:
stream);
}
+#if CUDA_VERSION >= 12080
template<typename InputIteratorT,
typename OutputIteratorT,
typename ScanOpT,
@@ -206,6 +207,7 @@ public:
num_items,
stream));
}
+#endif
template<typename InputIteratorT, typename OutputIteratorT, typename NumItemsT>
HIPCUB_RUNTIME_FUNCTION
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_select.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_select.hpp
index 6812c5cfeb..33bce4aa23 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_select.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_select.hpp
@@ -223,6 +223,7 @@ public:
stream);
}
+#if CUDA_VERSION >= 12060
template<typename InputIteratorT,
typename FlagIterator,
typename OutputIteratorT,
@@ -329,6 +330,7 @@ public:
select_op,
stream);
}
+#endif
template<typename InputIteratorT, typename OutputIteratorT, typename NumSelectedIteratorT>
HIPCUB_RUNTIME_FUNCTION
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_transform.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_transform.hpp
index 681a0bbf98..d071c7d859 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_transform.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/device/device_transform.hpp
@@ -30,6 +30,7 @@
#define HIBCUB_ROCPRIM_DEVICE_DEVICE_TRANSFORM_HPP_
#include "../../../config.hpp"
+#if CUDA_VERSION >= 12090
#include <hip/hip_runtime.h>
@@ -203,4 +204,5 @@ struct DeviceTransform
END_HIPCUB_NAMESPACE
+#endif
#endif // HIBCUB_ROCPRIM_DEVICE_DEVICE_TRANSFORM_HPP_
diff --git a/projects/hipcub/hipcub/include/hipcub/backend/cub/util_temporary_storage.hpp b/projects/hipcub/hipcub/include/hipcub/backend/cub/util_temporary_storage.hpp
index fc67d645b1..63540b717f 100644
--- a/projects/hipcub/hipcub/include/hipcub/backend/cub/util_temporary_storage.hpp
+++ b/projects/hipcub/hipcub/include/hipcub/backend/cub/util_temporary_storage.hpp
@@ -50,10 +50,17 @@ HIPCUB_HOST_DEVICE HIPCUB_FORCEINLINE hipError_t
void* (&allocations)[ALLOCATIONS],
const size_t (&allocation_sizes)[ALLOCATIONS])
{
+ #if CUDA_VERSION >= 12090
cudaError_t error = ::cub::detail::AliasTemporaries(d_temp_storage,
temp_storage_bytes,
allocations,
allocation_sizes);
+ #else
+ cudaError_t error = ::cub::AliasTemporaries(d_temp_storage,
+ temp_storage_bytes,
+ allocations,
+ allocation_sizes);
+ #endif
if(cudaSuccess == error)
{