Benchmark II

This section gives another example of benchmark measurement by computing the sum of all elements in a vector.

Sum of All Elements in a Vector

Below there’s a benchmark of computing the sum of all elements in a vector:

When comparing the parallel and serial execution time for the reduce function using Benchmark II, the results sometimes indicate that parallel execution takes more time than serial execution. The examples in this course use a machine with single hardware Hyper-thread with 3.75 GB of memory. You can disregard this unexpected result; on a traditional CPU, that usually has several hardware threads, parallel execution times would be lower than serial ones.

Get hands-on with 1200+ tech skills courses.