Added OMP thread count to test program. Discussion at https://groups.google.com/d/msg/cryptopp-users/M4vy6PFy40s/9n869TXAqoYJ
parent
17fea9df2a
commit
3829c7fd51
18
test.cpp
18
test.cpp
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue