Skip to content

Commit

Permalink
gemm_time
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hammond <[email protected]>
  • Loading branch information
jeffhammond committed Apr 15, 2024
1 parent 1cae2bd commit b2ffd2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cxx11/dgemm-cblas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int main(int argc, char * argv[])
// Allocate space for matrices
//////////////////////////////////////////////////////////////////////

double dgemm_time{0};
double gemm_time{0};

const int matrices = (batches==0 ? 1 : abs(batches));

Expand Down Expand Up @@ -283,7 +283,7 @@ int main(int argc, char * argv[])
{
for (int iter = 0; iter<=iterations; iter++) {

if (iter==1) dgemm_time = prk::wtime();
if (iter==1) gemm_time = prk::wtime();

if (batches == 0) {
prk_dgemm(order, A[0], B[0], C[0]);
Expand All @@ -293,7 +293,7 @@ int main(int argc, char * argv[])
prk_dgemm(order, matrices, pA, pB, pC);
}
}
dgemm_time = prk::wtime() - dgemm_time;
gemm_time = prk::wtime() - gemm_time;
}

//////////////////////////////////////////////////////////////////////
Expand All @@ -316,7 +316,7 @@ int main(int argc, char * argv[])
<< "Actual checksum = " << checksum << std::endl;
#endif
std::cout << "Solution validates" << std::endl;
auto avgtime = dgemm_time/iterations/matrices;
auto avgtime = gemm_time/iterations/matrices;
auto nflops = 2.0 * prk::pow(forder,3);
prk::print_flop_rate_time("FP64", nflops/avgtime, avgtime);
} else {
Expand Down

0 comments on commit b2ffd2b

Please sign in to comment.