 
   // Insert every pair into the map
   for(const auto& it : pairs){
-    this->the_map.insert(it);
+    this->the_map->insert(it);
   }
 
   // Make sure all the pairs are in the map
   for(const auto& it : pairs){
-    auto found = this->the_map.find(it.first);
-    EXPECT_NE(found, this->the_map.end());
+    auto found = this->the_map->find(it.first);
+    EXPECT_NE(found, this->the_map->end());
     EXPECT_EQ(found->first, it.first);
     EXPECT_EQ(found->second, it.second);
   }


template<typename map_type, typename Aggregation_Operator>
__global__ void build_table(map_type * const the_map,
                            const typename map_type::key_type* const input_keys,
                            const typename map_type::mapped_type* const input_values,
                            const typename map_type::size_type input_size,
                            Aggregation_Operator op)
{

  using size_type = typename map_type::size_type;

  const size_type i = threadIdx.x + blockIdx.x * blockDim.x;

  if( i < input_size ){
    the_map->insert(thrust::make_pair(input_keys[i], input_values[i]), op);
  }

}

TYPED_TEST(MapTest, AggregationTestDevice)
{
  using key_type = typename TypeParam::key_type;
  using value_type = typename TypeParam::value_type;

  std::vector<key_type>   keys   {0, 0, 0, 5, 5, 5, 10, 10, 10, 11, 12, 13};
  std::vector<value_type> values {0, 1, 2, 5, 5, 4, 13, 12, 11,  6, 97, 42};

  thrust::device_vector<key_type> d_keys{keys};
  thrust::device_vector<value_type> d_values{values};


  //using size_type = typename (this->the_map)::size_type;
  //size_type input_size = keys.size();

  //auto max = [] __device__ (value_type a, value_type b) { return (a >= b ? a : b); };

  //build_table<<<1,256>>>(&(this->the_map),
  //                        thrust::raw_pointer_cast(d_keys.data()),
  //                        thrust::raw_pointer_cast(d_values.data()),
  //                        input_size,
  //                        max);



}


// to nest multiple types inside of the KeyValueTypes struct above
// KeyValueTypes<type1, type2> implies key_type = type1, value_type = type2
// This list is the types across which Google Test will run our tests
typedef ::testing::Types< KeyValueTypes<int,int>,
                          KeyValueTypes<int,float>,
                          KeyValueTypes<int,double>,
                          KeyValueTypes<int,long long int>,
                          KeyValueTypes<int,unsigned long long int>,
