30 #ifndef HIPCUB_ROCPRIM_DEVICE_DEVICE_SCAN_HPP_
31 #define HIPCUB_ROCPRIM_DEVICE_DEVICE_SCAN_HPP_
34 #include "../../../config.hpp"
36 #include "../thread/thread_operators.hpp"
38 #include <rocprim/device/device_scan.hpp>
39 #include <rocprim/device/device_scan_by_key.hpp>
41 BEGIN_HIPCUB_NAMESPACE
47 typename InputIteratorT,
48 typename OutputIteratorT
50 HIPCUB_RUNTIME_FUNCTION
static
51 hipError_t InclusiveSum(
void *d_temp_storage,
52 size_t &temp_storage_bytes,
54 OutputIteratorT d_out,
56 hipStream_t stream = 0,
57 bool debug_synchronous =
false)
60 d_temp_storage, temp_storage_bytes,
62 stream, debug_synchronous
67 typename InputIteratorT,
68 typename OutputIteratorT,
71 HIPCUB_RUNTIME_FUNCTION
static
72 hipError_t InclusiveScan(
void *d_temp_storage,
73 size_t &temp_storage_bytes,
75 OutputIteratorT d_out,
78 hipStream_t stream = 0,
79 bool debug_synchronous =
false)
81 return ::rocprim::inclusive_scan(
82 d_temp_storage, temp_storage_bytes,
83 d_in, d_out, num_items,
85 stream, debug_synchronous
90 typename InputIteratorT,
91 typename OutputIteratorT
93 HIPCUB_RUNTIME_FUNCTION
static
94 hipError_t ExclusiveSum(
void *d_temp_storage,
95 size_t &temp_storage_bytes,
97 OutputIteratorT d_out,
99 hipStream_t stream = 0,
100 bool debug_synchronous =
false)
102 using T =
typename std::iterator_traits<InputIteratorT>::value_type;
103 return ExclusiveScan(
104 d_temp_storage, temp_storage_bytes,
106 stream, debug_synchronous
111 typename InputIteratorT,
112 typename OutputIteratorT,
116 HIPCUB_RUNTIME_FUNCTION
static
117 hipError_t ExclusiveScan(
void *d_temp_storage,
118 size_t &temp_storage_bytes,
120 OutputIteratorT d_out,
122 InitValueT init_value,
124 hipStream_t stream = 0,
125 bool debug_synchronous =
false)
127 return ::rocprim::exclusive_scan(
128 d_temp_storage, temp_storage_bytes,
129 d_in, d_out, init_value, num_items,
131 stream, debug_synchronous
136 typename InputIteratorT,
137 typename OutputIteratorT,
140 typename InitValueIterT = InitValueT*
142 HIPCUB_RUNTIME_FUNCTION
static
143 hipError_t ExclusiveScan(
void *d_temp_storage,
144 size_t &temp_storage_bytes,
146 OutputIteratorT d_out,
148 FutureValue<InitValueT, InitValueIterT> init_value,
150 hipStream_t stream = 0,
151 bool debug_synchronous =
false)
153 return ::rocprim::exclusive_scan(
154 d_temp_storage, temp_storage_bytes,
155 d_in, d_out, init_value, num_items,
157 stream, debug_synchronous
162 typename KeysInputIteratorT,
163 typename ValuesInputIteratorT,
164 typename ValuesOutputIteratorT,
167 HIPCUB_RUNTIME_FUNCTION
static
168 hipError_t ExclusiveSumByKey(
void *d_temp_storage,
169 size_t &temp_storage_bytes,
170 KeysInputIteratorT d_keys_in,
171 ValuesInputIteratorT d_values_in,
172 ValuesOutputIteratorT d_values_out,
174 EqualityOpT equality_op = EqualityOpT(),
175 hipStream_t stream = 0,
176 bool debug_synchronous =
false)
178 using in_value_type =
typename std::iterator_traits<ValuesInputIteratorT>::value_type;
180 return ::rocprim::exclusive_scan_by_key(
181 d_temp_storage, temp_storage_bytes,
182 d_keys_in, d_values_in, d_values_out,
183 static_cast<in_value_type
>(0),
static_cast<size_t>(num_items),
184 ::
hipcub::Sum(), equality_op, stream, debug_synchronous
189 typename KeysInputIteratorT,
190 typename ValuesInputIteratorT,
191 typename ValuesOutputIteratorT,
196 HIPCUB_RUNTIME_FUNCTION
static
197 hipError_t ExclusiveScanByKey(
void *d_temp_storage,
198 size_t &temp_storage_bytes,
199 KeysInputIteratorT d_keys_in,
200 ValuesInputIteratorT d_values_in,
201 ValuesOutputIteratorT d_values_out,
203 InitValueT init_value,
205 EqualityOpT equality_op = EqualityOpT(),
206 hipStream_t stream = 0,
207 bool debug_synchronous =
false)
209 return ::rocprim::exclusive_scan_by_key(
210 d_temp_storage, temp_storage_bytes,
211 d_keys_in, d_values_in, d_values_out,
212 init_value,
static_cast<size_t>(num_items),
213 scan_op, equality_op, stream, debug_synchronous
218 typename KeysInputIteratorT,
219 typename ValuesInputIteratorT,
220 typename ValuesOutputIteratorT,
223 HIPCUB_RUNTIME_FUNCTION
static
224 hipError_t InclusiveSumByKey(
void *d_temp_storage,
225 size_t &temp_storage_bytes,
226 KeysInputIteratorT d_keys_in,
227 ValuesInputIteratorT d_values_in,
228 ValuesOutputIteratorT d_values_out,
230 EqualityOpT equality_op = EqualityOpT(),
231 hipStream_t stream = 0,
232 bool debug_synchronous =
false)
234 return ::rocprim::inclusive_scan_by_key(
235 d_temp_storage, temp_storage_bytes,
236 d_keys_in, d_values_in, d_values_out,
238 equality_op, stream, debug_synchronous
243 typename KeysInputIteratorT,
244 typename ValuesInputIteratorT,
245 typename ValuesOutputIteratorT,
249 HIPCUB_RUNTIME_FUNCTION
static
250 hipError_t InclusiveScanByKey(
void *d_temp_storage,
251 size_t &temp_storage_bytes,
252 KeysInputIteratorT d_keys_in,
253 ValuesInputIteratorT d_values_in,
254 ValuesOutputIteratorT d_values_out,
257 EqualityOpT equality_op = EqualityOpT(),
258 hipStream_t stream = 0,
259 bool debug_synchronous =
false)
261 return ::rocprim::inclusive_scan_by_key(
262 d_temp_storage, temp_storage_bytes,
263 d_keys_in, d_values_in, d_values_out,
264 static_cast<size_t>(num_items), scan_op,
265 equality_op, stream, debug_synchronous
Definition: thread_operators.hpp:40
Definition: thread_operators.hpp:76