 /* The initial seed. */
 __device__ static unsigned long the_initial_seed = 0;
 __device__ static int initf = 0;
+__device__ static thrust::default_random_engine rng;
 
 /* Seeds */
 __host__ __device__ unsigned long THCRandom_seed()


__host__ __device__ unsigned long THCRandom_random()
{
  thrust::default_random_engine rng(the_initial_seed);
  thrust::uniform_int_distribution<unsigned long> ufm(0,(((unsigned long)1)<<31)-1);
  return ufm(rng);
}

__host__ __device__ void THCRandom_manualSeed(unsigned long the_seed_)
{
  the_initial_seed = the_seed_;
  rng.seed(the_initial_seed);
}

__host__ __device__ unsigned long THCRandom_initialSeed()
