Add __host__ __device__ to thrust::generate and thrust::generate_n.