diff --git a/main.cpp b/main.cpp index 5379bb9..51f7e48 100644 --- a/main.cpp +++ b/main.cpp @@ -133,7 +133,7 @@ void run() stream->write_arrays(a, b, c); // List of times - std::vector> timings(4); + std::vector> timings(5); // Declare timers std::chrono::high_resolution_clock::time_point t1, t2; @@ -165,6 +165,12 @@ void run() t2 = std::chrono::high_resolution_clock::now(); timings[3].push_back(std::chrono::duration_cast >(t2 - t1).count()); + // Execute Dot + t1 = std::chrono::high_resolution_clock::now(); + stream->dot(); + t2 = std::chrono::high_resolution_clock::now(); + timings[4].push_back(std::chrono::duration_cast >(t2 - t1).count()); + } // Check solutions @@ -181,15 +187,16 @@ void run() std::cout << std::fixed; - std::string labels[4] = {"Copy", "Mul", "Add", "Triad"}; - size_t sizes[4] = { + std::string labels[5] = {"Copy", "Mul", "Add", "Triad", "Dot"}; + size_t sizes[5] = { 2 * sizeof(T) * ARRAY_SIZE, 2 * sizeof(T) * ARRAY_SIZE, 3 * sizeof(T) * ARRAY_SIZE, - 3 * sizeof(T) * ARRAY_SIZE + 3 * sizeof(T) * ARRAY_SIZE, + 2 * sizeof(T) * ARRAY_SIZE }; - for (int i = 0; i < 4; i++) + for (int i = 0; i < 5; i++) { // Get min/max; ignore the first result auto minmax = std::minmax_element(timings[i].begin()+1, timings[i].end());