* @brief Calculate and print the speedup obtained by multithreading. * * @param timings A vector of the timings corresponding to different numbers of tasks. * @param try_tasks A vector containing the numbers of tasks tried. */
| 3159 | * @param try_tasks A vector containing the numbers of tasks tried. |
| 3160 | */ |
| 3161 | void print_speedup(const std::vector<double>& timings, const std::vector<std::size_t>& try_tasks) |
| 3162 | { |
| 3163 | const std::size_t min_el = min_element_index(timings); |
| 3164 | const double max_speedup = std::round((timings[0] / timings[min_el]) * 10) / 10; |
| 3165 | const std::size_t num_tasks = try_tasks[min_el]; |
| 3166 | logln("Maximum speedup obtained by multithreading vs. single-threading: ", max_speedup, "x, using ", num_tasks, " tasks."); |
| 3167 | } |
| 3168 | |
| 3169 | /** |
| 3170 | * @brief Calculate the mean and standard deviation of a set of integers. |
no test coverage detected