| 223 | } |
| 224 | |
| 225 | void 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 | |
| 249 | void RNG::resetDimensions(void) |
| 250 | { |