     h_result_keys.erase(h_end.first, h_result_keys.end());
     h_result_vals.erase(h_end.second, h_result_vals.end());
 
-    merge_by_key_kernel<<<1,1>>>(d_a_keys.begin(), d_a_keys.end(),
+    merge_by_key_kernel<<<1,1>>>(exec,
+                                 d_a_keys.begin(), d_a_keys.end(),
                                  d_b_keys.begin(), d_b_keys.end(),
                                  d_a_vals.begin(),
                                  d_b_vals.begin(),

         typename Iterator6,
         typename Iterator7>
__global__
void merge_by_key_kernel(Iterator1 keys_first1, Iterator1 keys_last1,
                         Iterator2 keys_first2, Iterator2 keys_last2,
                         Iterator3 values_first1,
                         Iterator4 values_first2,

                         Iterator6 values_result,
                         Iterator7 result)
{
  *result = thrust::merge_by_key(exec, keys_first1, keys_last1, keys_first2, keys_last2, values_first1, values_first2, keys_result, values_result);
}


template<typename T, typename ExecutionPolicy>
void TestMergeByKeyDevice(ExecutionPolicy exec, size_t n)
{
  thrust::host_vector<T> random_keys = unittest::random_integers<unittest::int8_t>(n);
  thrust::host_vector<T> random_vals = unittest::random_integers<unittest::int8_t>(n);
