Skip to content

Commit

Permalink
bench: reset seed with num bench
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Jan 24, 2024
1 parent 5a60e6c commit c5d67f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions MMVII/src/Bench/BenchGlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ bool cParamExeBench::NewBench(const std::string & aName,bool ExactMatch)
mNbExe++;
mInsideFunc = true;
StdOut() << " Bench : " << aName << std::endl;

std::string aSeedStr = aName + "/" + std::to_string(mCurLev);
std::size_t aSeedVal = std::hash<std::string>{}(aSeedStr);
// StdOut() << " reinit seed to: " << aSeedStr << " / " << aSeedVal << "\n";
cRandGenerator::TheOne()->setSeed(aSeedVal);
cRandGenerator::TheOne()->setSeed(mCurLev);
}
return mInsideFunc;
}
Expand Down
4 changes: 0 additions & 4 deletions MMVII/src/UtiMaths/uti_rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ void OneBench_Random_Generator(cParamExeBench & aParam)
for (auto &v: aRefSequenceRawSeed0)
MMVII_INTERNAL_ASSERT_bench(cRandGenerator::TheOne()->next()==v,"Random Seq Raw Seed 0");

// test hashing function used for seed reset on each bench
std::size_t aHashVal = std::hash<std::string>{}("Toto");
MMVII_INTERNAL_ASSERT_bench(aHashVal==4574758675877946257,"Hash of string");

already_done = true;
}

Expand Down

0 comments on commit c5d67f3

Please sign in to comment.