MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / matrix_multiplication

Function matrix_multiplication

check/TestHighsParallel.cpp:188–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186double **a = nullptr, **b = nullptr, **c = nullptr;
187
188void matrix_multiplication(const std::string& model, const unsigned num_threads,
189 const unsigned num_rounds) {
190 if (dev_run)
191 std::cout << std::setw(12) << "size" << std::setw(12) << "runtime"
192 << std::endl;
193
194 for (int i = 128; i <= 512; i += 128) {
195 N = i;
196
197 allocate_matrix();
198
199 double runtime{0.0};
200
201 for (unsigned j = 0; j < num_rounds; ++j) {
202#if 0
203 if (model == "highs") {
204 runtime += measure_time_highs(num_threads).count();
205 } else if (model == "omp") {
206 runtime += measure_time_omp(num_threads).count();
207 } else
208 assert(false);
209#else
210 runtime += measure_time_highs(num_threads).count();
211#endif
212 }
213
214 if (dev_run)
215 std::cout << std::setw(12) << N << std::setw(12)
216 << runtime / num_rounds / 1e3 << std::endl;
217
218 deallocate_matrix();
219 }
220}
221
222TEST_CASE("MatrixMultHighs", "[parallel]") {
223 HighsTaskExecutor::shutdown();

Callers 1

Calls 5

allocate_matrixFunction · 0.85
measure_time_highsFunction · 0.85
measure_time_ompFunction · 0.85
deallocate_matrixFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected