2828
2929#ifdef _OPENMP
3030#include < omp.h>
31+ #include < cmath>
3132#endif
3233
3334#ifdef USE_MKL
@@ -136,8 +137,6 @@ double measureWithWarmup(
136137 {
137138#endif
138139 for (int i = 0 ; i < measuredIterations; ++i) {
139- std::chrono::time_point<std::chrono::high_resolution_clock> start, end;
140-
141140 const auto thread_id = useOpenMP ? fbgemm_get_thread_num () : 0 ;
142141
143142 if (thread_id == 0 ) {
@@ -149,7 +148,7 @@ double measureWithWarmup(
149148#pragma omp barrier
150149 }
151150#endif
152- start = std::chrono::high_resolution_clock::now ();
151+ auto start = std::chrono::high_resolution_clock::now ();
153152
154153 fn ();
155154
@@ -159,7 +158,7 @@ double measureWithWarmup(
159158 }
160159#endif
161160
162- end = std::chrono::high_resolution_clock::now ();
161+ auto end = std::chrono::high_resolution_clock::now ();
163162 auto dur =
164163 std::chrono::duration_cast<std::chrono::nanoseconds>(end - start);
165164
@@ -256,7 +255,6 @@ void performance_test(
256255#endif
257256
258257 std::string type;
259- double gflops, gbs, ttot;
260258 for (auto s : shapes) {
261259 int m = s[0 ];
262260 int n = s[1 ];
@@ -266,6 +264,7 @@ void performance_test(
266264 aligned_vector<int > Aint (m * k);
267265 randFill (Aint, 0 , 4 );
268266 std::vector<aligned_vector<float >> A;
267+ A.reserve (num_instances);
269268 for (int i = 0 ; i < num_instances; ++i) {
270269 A.emplace_back (Aint.begin (), Aint.end ());
271270 }
@@ -321,6 +320,7 @@ void performance_test(
321320
322321 double nflops = 2.0 * m * n * k;
323322 double nbytes = 4.0 * m * k + sizeof (btype) * 1.0 * k * n + 4.0 * m * n;
323+ double gflops = 0 , gbs = 0 , ttot = 0.0 ;
324324
325325 // warm up MKL and fbgemm
326326 // check correctness at the same time
0 commit comments