 
   // Generate the random values
   for (size_t i = 0; i < N; ++i) {
-    input[i] = std::min((unsigned int) std::max((int)normalDist(rng), 0), numBins - 1);
+    input[i] = std::min((unsigned int) std::max((int)normalDist(rng), 0), (unsigned int) (numBins - 1));
   }
 
   // demonstrate dense histogram method

  }
  end = clock();
  timer.Stop();
  time_taken = (double)(end-start) * 1000.0/CLOCKS_PER_SEC;
  printf("time taken: %3.2f msecs\n", time_taken);

  

{
  const int numBins = 1024;
  const int N = numBins*10000;
  const float stddev = 100.f;

  // generate random data on the host
  thrust::host_vector<int> input(N);
