 __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()

__host__ __device__ double THCRandom_normal(double mean, double stdv)
{
  //THArgCheck(stdv > 0, 2, "standard deviation must be strictly positive");
  thrust::default_random_engine rng(the_initial_seed);
  thrust::random::experimental::normal_distribution<double> normal(mean,stdv);
  return normal(rng);
}


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