From the course: Parallel and Concurrent Programming with C++ Part 2

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Measure speedup: C++ demo

Measure speedup: C++ demo - C++ Tutorial

From the course: Parallel and Concurrent Programming with C++ Part 2

Start my 1-month free trial

Measure speedup: C++ demo

- [Instructor] To demonstrate how we'll measure the speedup of a parallel program in C++, we'll use the recursive sum algorithm we created in an earlier video. It uses a divide and conquer approach to sum together all of the numbers within a range of values. The parallelized implementation of the algorithm is contained within the parallel_sum function on line 15. But since we've already covered how it works, we'll use code folding to hide it for now. The sequential summing algorithm used for comparison is in the sequential_sum function on line seven. I'll hide that too. The main function of this program contains a simple framework we'll be using to evaluate the performance of parallel algorithms. On line 31, we have a variable to indicate the number of evaluation runs for each implementation to execute and measure the execution times, and then we'll average those times together. Increasing that number of evaluation runs…

Contents