MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / resetSeed

Method resetSeed

cpp/4_CUDA_Libraries/randomFog/rng.cpp:225–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void RNG::resetSeed(void)
226{
227 using std::runtime_error;
228
229 curandStatus_t curandResult;
230 curandResult = curandSetPseudoRandomGeneratorSeed(m_prng, m_prngSeed);
231
232 if (curandResult != CURAND_STATUS_SUCCESS) {
233 std::string msg("Could not set pseudo-random number generator seed: ");
234 msg += curandResult;
235 throw runtime_error(msg);
236 }
237
238 curandResult = curandSetGeneratorOffset(m_prng, 0);
239
240 if (curandResult != CURAND_STATUS_SUCCESS) {
241 std::string msg("Could not set pseudo-random number generator offset: ");
242 msg += curandResult;
243 throw runtime_error(msg);
244 }
245
246 setBatchSize();
247}
248
249void RNG::resetDimensions(void)
250{

Callers 1

keyboardFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected