13 #include "Vector/map_vector.hpp" 14 #include "util/cuda_launch.hpp" 16 #if CUDART_VERSION >= 11000 22 #include <thrust/merge.h> 23 #include <thrust/execution_policy.h> 27 #include <thrust/merge.h> 28 #include <thrust/execution_policy.h> 32 #include <thrust/merge.h> 33 #include <thrust/execution_policy.h> 36 #include "util/cuda/ofp_context.hxx" 41 template<
typename a_keys_it,
typename a_vals_it,
42 typename b_keys_it,
typename b_vals_it,
43 typename c_keys_it,
typename c_vals_it,
44 typename comp_t,
typename context_t>
45 void merge(a_keys_it a_keys, a_vals_it a_vals,
int a_count,
46 b_keys_it b_keys, b_vals_it b_vals,
int b_count,
47 c_keys_it c_keys, c_vals_it c_vals, comp_t comp, context_t& context)
55 while (a_it < a_count || b_it < b_count)
61 if (comp(b_keys[b_it],a_keys[a_it]))
63 c_keys[c_it] = b_keys[b_it];
64 c_vals[c_it] = b_vals[b_it];
70 c_keys[c_it] = a_keys[a_it];
71 c_vals[c_it] = a_vals[a_it];
78 c_keys[c_it] = a_keys[a_it];
79 c_vals[c_it] = a_vals[a_it];
86 c_keys[c_it] = b_keys[b_it];
87 c_vals[c_it] = b_vals[b_it];
97 thrust::merge_by_key(thrust::device, a_keys,a_keys + a_count,
98 b_keys,b_keys + b_count,
108 thrust::merge_by_key(thrust::device, a_keys,a_keys + a_count,
109 b_keys,b_keys + b_count,
convert a type into constant type