-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver_search.cpp
47 lines (37 loc) · 1.22 KB
/
driver_search.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "unif01.h"
#include "bbattery.h"
#include "swrite.h"
#include "workload.hpp"
#include <iostream>
#include <random>
#include <chrono>
#include "tbb/parallel_for.h"
#define PARALLEL_RNGs 9
int main (int argc, char *argv[])
{
// Turn off all printing to stdout from TestU01s
// You may want to try flipping this to 1 to see what it is actually doing.
swrite_Basic=0;
/* Parallel execution */
unif01_Gen * genArray[PARALLEL_RNGs];
std::string nameArray[PARALLEL_RNGs];
//Loop forever - the user will kill the process
while(1){
/* Store the RNG instances in a vector */
for(int i=0; i<PARALLEL_RNGs; i++){
genArray[i] = workload_Create();
nameArray[i] = workload_Name(genArray[i]);
workload_Next();
}
/* Test the RNGs in parallel */
tbb::parallel_for(0u, (unsigned)PARALLEL_RNGs, [&](unsigned i){
std::vector<bbattery_Result> results;
results=bbattery_ParallelSmallCrush(genArray[i]);
for(auto & r : results){
fprintf(stdout, "%s, %d, %s, %d, %.16g\n", nameArray[i].c_str(), r.TestIndex, r.TestName.c_str(), r.SubIndex, r.pVal);
}
fflush(stdout);
});
}
return 0;
}