random - Seeding QUASI_SCRAMBLED_SOBOL64 in CURAND -
how can seed curand_rng_quasi_scrambled_sobol64
generator? because gives me same numbers every time run , can't use curandsetpseudorandomgeneratorseed
curand_rng_quasi_scrambled_sobol64
generate 64 bit random integers curandgeneratelonglong
.
how seed generator in following code?
size_t n = 10; curandgenerator_t gen; unsigned long long *devdata, *hostdata; hostdata = (unsigned long long *)calloc(n, sizeof(unsigned long long)); cudamalloc(&devdata, n*sizeof(unsigned long long)); curandcreategenerator(&gen, curandrngtype_t::curand_rng_quasi_scrambled_sobol64); (size_t j = 0; j < 3; j++) { curandgeneratelonglong(gen, devdata, n); cudamemcpy(hostdata, devdata, n * sizeof(unsigned long long), cudamemcpydevicetohost); (size_t = 0; < 3; i++) { printf("%llx\n", hostdata[i]); } printf("\n\n"); } curanddestroygenerator(gen); cudafree(devdata); free(hostdata);
as per docuementation, quasi random generators, sobol generator using, don't use seed. use offset , dimension vector initialise generator.
so initialisation sequence in code should like
curandcreategenerator(&gen, curandrngtype_t::curand_rng_quasi_scrambled_sobol64); curandsetgeneratoroffset (gen, std::time(0)); curandsetquasirandomgeneratordimensions(gen, 10);
Comments
Post a Comment