+#include "cuda_runtime.h"
+#include "device_launch_parameters.h"
+
+#include <thrust/host_vector.h>
+#include <thrust/device_vector.h>
+#include <thrust/scan.h>
+#include <thrust/execution_policy.h>
 #include <iostream>
 #include <vector>
 #include <cassert>
 
 #include <Scan.h>
 
-#include "cuda_runtime.h"
-#include "device_launch_parameters.h"
 
 #include <stdio.h>
 

  assertSuccess(cudaFreeHost(sum_h));
}


int main()
{
  assertSuccess(cudaSetDevice(0));

  runSize(static_cast<uint32_t>(0u));
  for (uint64_t N = 0; N < (uint64_t)(1 << 31 - 1); N = (N == 0 ? 1 : 7 * N + N / 3))
  {
    runSize(static_cast<uint32_t>(N));
  }
  //runSize(1 << 31 - 1);


  return 0;

#define assertSuccess(a) do { cudaError_t rv = (a); if(rv != cudaSuccess) logFailure(rv, __FILE__, __LINE__); } while(0)


void runTest(uint32_t N)
{
  std::vector<uint32_t> offsets(N + 1);
  std::vector<uint32_t> counts(N);
