Skip to content

Commit

Permalink
Use a reproducible seed in test rng. (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper authored Apr 12, 2024
1 parent 60761e0 commit 555d628
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/stdrel_criterion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void test_const()

std::vector<double> generate(double mean, double rel_std_dev, int size)
{
std::random_device rd;
std::mt19937 gen(rd());
static std::mt19937::result_type seed = 0;
std::mt19937 gen(seed++);
std::vector<nvbench::float64_t> v(static_cast<std::size_t>(size));
std::normal_distribution<nvbench::float64_t> dist(mean, mean * rel_std_dev);
std::generate(v.begin(), v.end(), [&]{ return dist(gen); });
Expand Down

0 comments on commit 555d628

Please sign in to comment.