pull/2/head
Jeffrey Walton 2015-06-13 21:11:22 -04:00
parent 17fea9df2a
commit 3829c7fd51
1 changed files with 17 additions and 1 deletions

View File

@ -42,6 +42,10 @@
#include <console.h> #include <console.h>
#endif #endif
#ifdef _OPENMP
# include <omp.h>
#endif
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma comment(lib, "cryptlib_bds.lib") #pragma comment(lib, "cryptlib_bds.lib")
#pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "ws2_32.lib")
@ -769,9 +773,21 @@ bool Validate(int alg, bool thorough, const char *seedInput)
std::string seed = seedInput ? std::string(seedInput) : IntToString(time(NULL)); std::string seed = seedInput ? std::string(seedInput) : IntToString(time(NULL));
seed.resize(16); seed.resize(16);
cout << "Using seed: " << seed << endl << endl; cout << "Using seed: " << seed << endl;
s_globalRNG.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data()); s_globalRNG.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data());
#ifdef _OPENMP
int tc = 0;
#pragma omp parallel
{
tc = omp_get_num_threads();
}
cout << "Using " << tc << " OMP " << (tc == 1 ? "thread" : "threads") << endl;
#endif
cout << endl;
switch (alg) switch (alg)
{ {
case 0: result = ValidateAll(thorough); break; case 0: result = ValidateAll(thorough); break;