 template <typename T>
 struct stl_sort_test
 {
-  typedef typename std::vector<T> Vector;  Vector v;
-  void        setup(void) { v.resize(N);  randomize(v); }
+  typedef typename std::vector<T> Vector; Vector v;
+  void        setup(void) { v.resize(N); randomize(v); }
   void        run(void)   { std::sort(v.begin(), v.end()); }
   std::string name(void)  { return std::string("std::sort");  }
 };

#endif

  std::cout << "Benchmarking with input size " << N << std::endl;
  benchmark_core_primitives<int>("32-bit integer");
  benchmark_core_primitives<long long>("64-bit integer");
  benchmark_core_primitives<float>("32-bit float");
  benchmark_core_primitives<double>("64-bit float");

  printf("Sorting Performance (keys per second)\n");

#ifdef NO_TBB
  printf("%6s, %12s, %12s, %12s\n", "Type", "STL", "TBB (n/a)", "Thrust");
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "char",   rate(stl_sort_test<char>()),      0.0,  rate(thrust_sort_test<char>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "short",  rate(stl_sort_test<short>()),     0.0,  rate(thrust_sort_test<short>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "int",    rate(stl_sort_test<int>()),       0.0,  rate(thrust_sort_test<int>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "long",   rate(stl_sort_test<long long>()), 0.0,  rate(thrust_sort_test<long long>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "float",  rate(stl_sort_test<float>()),     0.0,  rate(thrust_sort_test<float>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "double", rate(stl_sort_test<double>()),    0.0,  rate(thrust_sort_test<double>()));
#else
  printf("%6s, %12s, %12s, %12s\n", "Type", "STL", "TBB", "Thrust");
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "char",   rate(stl_sort_test<char>()),      rate(tbb_sort_test<char>()),      rate(thrust_sort_test<char>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "short",  rate(stl_sort_test<short>()),     rate(tbb_sort_test<short>()),     rate(thrust_sort_test<short>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "int",    rate(stl_sort_test<int>()),       rate(tbb_sort_test<int>()),       rate(thrust_sort_test<int>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "long",   rate(stl_sort_test<long long>()), rate(tbb_sort_test<long long>()), rate(thrust_sort_test<long long>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "float",  rate(stl_sort_test<float>()),     rate(tbb_sort_test<float>()),     rate(thrust_sort_test<float>()));
  printf("%6s, %12.0f, %12.0f, %12.0f\n", "double", rate(stl_sort_test<double>()),    rate(tbb_sort_test<double>()),    rate(thrust_sort_test<double>()));
#endif

  return 0;
}

template <typename T>
struct stl_transform_test
{
  typedef typename std::vector<T> Vector; Vector v;
  void        setup(void) { v.resize(N); randomize(v); }
  void        run(void)   { std::transform(v.begin(), v.end(), v.begin(), thrust::negate<int>()); }
  std::string name(void)  { return std::string("std::transform");  }
};

template <typename T>
struct stl_inclusive_scan_test
{
  typedef typename std::vector<T> Vector; Vector v;
  void        setup(void) { v.resize(N); randomize(v); }
  void        run(void)   { std::partial_sum(v.begin(), v.end(), v.begin()); }
  std::string name(void)  { return std::string("std::partial_sum");  }
};
