         }
 
         // Store current key and value
-        keys.push_back(current_key);
-        values.push_back(current_value);
+        pairs.push_back(std::make_pair(current_key, current_value));
 
         // Use a STL map to keep track of the max value for each key
         auto found = expected_values.find(current_key);

  {
  }

  int create_input(const int num_unique_keys, const int num_values_per_key, const int max_key = RAND_MAX, const int max_value = RAND_MAX)
  {


    const int TOTAL_PAIRS = num_unique_keys * num_values_per_key;

    this->the_map.reset(new map_type(2*TOTAL_PAIRS));

    keys.reserve(TOTAL_PAIRS);
    values.reserve(TOTAL_PAIRS);

    // Always use the same seed so the random sequence is the same each time
    std::srand(0);

  EXPECT_EQ(11, found->second);

}


template<typename map_type, typename Aggregation_Operator>
__global__ void build_table(map_type * const the_map,
                            const typename map_type::value_type * const input_pairs,
                            const typename map_type::size_type input_size,
                            Aggregation_Operator op)
{
