43 public static void Main(
string[] args)
47 var nrCandidates = 5000000;
61 nrCandidates =
int.Parse(args[1]);
65 nrSpectra =
int.Parse(args[2]);
69 topN =
int.Parse(args[3]);
73 batchSize =
int.Parse(args[4]);
79 var status =
Cuda(nrCandidates, nrSpectra, topN, batchSize, r,
false, 1);
80 Console.WriteLine($
"Cuda routine exited with status: {status}");
82 else if (mode ==
"CudaB")
84 var status =
Cuda(nrCandidates, nrSpectra, topN, batchSize, r,
true, 1);
85 Console.WriteLine($
"Cuda routine exited with status: {status}");
87 else if (mode ==
"CudaBAlt")
89 var status =
Cuda(nrCandidates, nrSpectra, topN, batchSize, r,
true, 2);
90 Console.WriteLine($
"Cuda routine exited with status: {status}");
92 else if (mode ==
"Eigen")
94 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
false,
false);
95 Console.WriteLine($
"Eigen routine exited with status: {status}");
97 else if (mode ==
"EigenInt")
99 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
false,
false,
true);
100 Console.WriteLine($
"Eigen routine exited with status: {status}");
102 else if (mode ==
"EigenB")
104 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
true,
false);
105 Console.WriteLine($
"Eigen routine exited with status: {status}");
107 else if (mode ==
"EigenIntB")
109 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
true,
false,
true);
110 Console.WriteLine($
"Eigen routine exited with status: {status}");
112 else if (mode ==
"EigenS")
114 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
false,
true);
115 Console.WriteLine($
"Eigen routine exited with status: {status}");
117 else if (mode ==
"EigenSInt")
119 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
false,
true,
true);
120 Console.WriteLine($
"Eigen routine exited with status: {status}");
122 else if (mode ==
"EigenSB")
124 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
true,
true);
125 Console.WriteLine($
"Eigen routine exited with status: {status}");
127 else if (mode ==
"EigenSIntB")
129 var status =
Eigen(nrCandidates, nrSpectra, topN, batchSize, r,
true,
true,
true);
130 Console.WriteLine($
"Eigen routine exited with status: {status}");
132 else if (mode ==
"Benchmark")
134 var status =
Benchmark(nrCandidates, nrSpectra, topN, batchSize, r);
135 Console.WriteLine($
"Compare routine exited with status: {status}");
137 else if (mode ==
"Compare")
139 var status =
Compare(nrCandidates, nrSpectra, topN, batchSize, r);
140 Console.WriteLine($
"Compare routine exited with status: {status}");
142 else if (mode ==
"CompareD")
145 Console.WriteLine($
"Deterministic compare routine exited with status: {status}");
149 Console.WriteLine(
"No mode selected, has to be one of: Eigen(S)(Int), Eigen(S)(Int)B, Cuda(B/BAlt), Compare, Benchmark.");
152 Console.WriteLine(
"Done!");
static int Cuda(int nrCandidates, int nrSpectra, int topN, int batchSize, Random r, bool batched, int batchMode)
Wrapper for testing GPU-based matrix multiplication functions.
static int Benchmark(int nrCandidates, int nrSpectra, int topN, int batchSize, Random r)
Function to run synthetic benchmarks of all the different matrix multiplication functions.
static int Eigen(int nrCandidates, int nrSpectra, int topN, int batchSize, Random r, bool batched, bool sparse, bool useInt=false)
Wrapper for testing CPU-based matrix multiplication functions.
static int Compare(int nrCandidates, int nrSpectra, int topN, int batchSize, Random r)
Function to compare the results of all the different matrix multiplication functions.