I’m looking for a device random number generator engine that reproduces the same sequence of random numbers as the C++11 std::mt19937 standard for a given seed. Will the pseudo code below provide it?
int seed = 0;
int nRand = 1;
float randNum = -9;
curandGenerator_t prngGPU
curandCreateGenerator( prngGPU ,CURAND_RNG_PSEUDO_MT19937)
curandSetPseudoRandomGeneratorSeed( prngGPU, seed)
curandGenerateUniform( prnGPU, (float *) randNum, nRand)
C++11:
std::mt19937 mTwist;
std::uniform_real_distribution dist(0.0,1.0);
mTwist.seed(0);
float cpp_ranNum = dist( mTwist )
</newish cuda developer>