30 #ifndef HIPCUB_ROCPRIM_DEVICE_DEVICE_MERGE_SORT_HPP_
31 #define HIPCUB_ROCPRIM_DEVICE_DEVICE_MERGE_SORT_HPP_
33 #include "../../../config.hpp"
35 #include "../util_type.hpp"
37 #include <rocprim/device/device_merge_sort.hpp>
39 BEGIN_HIPCUB_NAMESPACE
41 struct DeviceMergeSort
43 template<
typename KeyIteratorT,
typename ValueIteratorT,
typename OffsetT,
typename CompareOpT>
44 HIPCUB_RUNTIME_FUNCTION
static hipError_t SortPairs(
void * d_temp_storage,
45 std::size_t & temp_storage_bytes,
47 ValueIteratorT d_items,
49 CompareOpT compare_op,
50 hipStream_t stream = 0,
51 bool debug_synchronous =
false)
53 return ::rocprim::merge_sort(d_temp_storage,
65 template<
typename KeyInputIteratorT,
66 typename ValueInputIteratorT,
67 typename KeyIteratorT,
68 typename ValueIteratorT,
71 HIPCUB_RUNTIME_FUNCTION
static hipError_t SortPairsCopy(
void * d_temp_storage,
72 std::size_t & temp_storage_bytes,
73 KeyInputIteratorT d_input_keys,
74 ValueInputIteratorT d_input_items,
75 KeyIteratorT d_output_keys,
76 ValueIteratorT d_output_items,
78 CompareOpT compare_op,
79 hipStream_t stream = 0,
80 bool debug_synchronous =
false)
82 return ::rocprim::merge_sort(d_temp_storage,
94 template<
typename KeyIteratorT,
typename OffsetT,
typename CompareOpT>
95 HIPCUB_RUNTIME_FUNCTION
static hipError_t SortKeys(
void * d_temp_storage,
96 std::size_t & temp_storage_bytes,
99 CompareOpT compare_op,
100 hipStream_t stream = 0,
101 bool debug_synchronous =
false)
103 return ::rocprim::merge_sort(
104 d_temp_storage, temp_storage_bytes,
105 d_keys, d_keys, num_items,
106 compare_op, stream, debug_synchronous
110 template<
typename KeyInputIteratorT,
111 typename KeyIteratorT,
114 HIPCUB_RUNTIME_FUNCTION
static hipError_t SortKeysCopy(
void * d_temp_storage,
115 std::size_t & temp_storage_bytes,
116 KeyInputIteratorT d_input_keys,
117 KeyIteratorT d_output_keys,
119 CompareOpT compare_op,
120 hipStream_t stream = 0,
121 bool debug_synchronous =
false)
124 return ::rocprim::merge_sort(
125 d_temp_storage, temp_storage_bytes,
126 d_input_keys, d_output_keys, num_items,
127 compare_op, stream, debug_synchronous
131 template <
typename KeyIteratorT,
132 typename ValueIteratorT,
135 HIPCUB_RUNTIME_FUNCTION
static hipError_t
136 StableSortPairs(
void *d_temp_storage,
137 std::size_t &temp_storage_bytes,
139 ValueIteratorT d_items,
141 CompareOpT compare_op,
142 hipStream_t stream = 0,
143 bool debug_synchronous =
false)
145 return ::rocprim::merge_sort(d_temp_storage,
157 template<
typename KeyIteratorT,
typename OffsetT,
typename CompareOpT>
158 HIPCUB_RUNTIME_FUNCTION
static hipError_t StableSortKeys(
void * d_temp_storage,
159 std::size_t & temp_storage_bytes,
162 CompareOpT compare_op,
163 hipStream_t stream = 0,
164 bool debug_synchronous =
false)
166 return ::rocprim::merge_sort(
167 d_temp_storage, temp_storage_bytes,
168 d_keys, d_keys, num_items,
169 compare_op, stream, debug_synchronous
173 template<
typename KeyInputIteratorT,
174 typename KeyIteratorT,
177 HIPCUB_RUNTIME_FUNCTION
static hipError_t StableSortKeysCopy(
void* d_temp_storage,
178 std::size_t& temp_storage_bytes,
179 KeyInputIteratorT d_input_keys,
180 KeyIteratorT d_output_keys,
182 CompareOpT compare_op,
183 hipStream_t stream = 0,
184 bool debug_synchronous =
false)
186 return ::rocprim::merge_sort(d_temp_storage,