mirror of
https://github.com/amd/blis.git
synced 2026-04-20 07:38:53 +00:00
Fixing bench overflow in GFLOPS computation
Fixing a bug in some bench applications where GFLOPS computation ran into integer overflows because explicit type casting to double was not done in the computation removing all multiplies by 1.0 during GFLOP computation AMD-Internal: CPUPL-7016 --------- Co-authored-by: Rayan <rohrayan@amd.com>
This commit is contained in:
@@ -217,7 +217,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( 1.0 * n ) / dtime_save / 1.0e9;
|
||||
gflops = (double)n / ( dtime_save * 1.0e9 );
|
||||
if ( bli_obj_is_complex( &x ) ) gflops *= 2.0;
|
||||
|
||||
#ifdef PRINT
|
||||
|
||||
@@ -202,7 +202,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = n / ( dtime_save * 1.0e9 );
|
||||
gflops = (double)n / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 2.0;
|
||||
|
||||
printf( "data_asumv_%s", BLAS );
|
||||
|
||||
@@ -243,7 +243,7 @@ int main( int argc, char** argv )
|
||||
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
gflops = ( 3.0 * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 3.0 * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
printf( "data_axpbyv_%s", BLAS );
|
||||
|
||||
@@ -236,7 +236,7 @@ int main( int argc, char** argv )
|
||||
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
gflops = ( 3.0 * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 3.0 * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
printf( "data_axpyv_%s", BLAS );
|
||||
|
||||
@@ -241,8 +241,8 @@ int main( int argc, char** argv )
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gflops = (n * 1) / (dtime_save * 1.0e9);
|
||||
if(bli_is_complex(dt)) gflops *= 2;
|
||||
gflops = (double)n / (dtime_save * 1.0e9);
|
||||
if(bli_is_complex(dt)) gflops *= 2.0;
|
||||
|
||||
printf( "data_copyv_%s", BLAS );
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( 2.0 * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 2.0 * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
printf( "data_dotv_%s", BLAS );
|
||||
|
||||
@@ -470,7 +470,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( 2.0 * m * k * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 2.0 * (double)m * (double)k * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -962,7 +962,7 @@ int main( int argc, char** argv )
|
||||
#endif
|
||||
}
|
||||
|
||||
gflops = ( 2.0 * m * k * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 2.0 * (double)m * (double)k * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -453,7 +453,9 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( n * k * n ) / ( dtime_save * 1.0e9 );
|
||||
// if n * k * n is not explicitly type cast, then there are cases where n*k*n overflows
|
||||
// which results in negative gflops.
|
||||
gflops = ( (double)n * (double)k * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( 2.0 * m * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 2.0 * (double)m * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( 2.0 * m * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( 2.0 * (double)m * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = (2*n) / ( dtime_save * 1.0e9 );
|
||||
gflops = (2.0 * (double)n) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 2.0;
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = n / ( dtime_save * 1.0e9 );
|
||||
gflops = (double)n / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt_x ) )
|
||||
{
|
||||
|
||||
@@ -225,7 +225,7 @@ int main( int argc, char** argv )
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gflops = ( 1.0 * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = (double)n / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
printf( "data_swapv_%s", BLAS );
|
||||
|
||||
@@ -401,7 +401,9 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
|
||||
gflops = ( n * k * n ) / ( dtime_save * 1.0e9 );
|
||||
// if n * k * n is not explicitly type cast, then there are cases where n*k*n overflows
|
||||
// which results in negative gflops.
|
||||
gflops = ( (double)n * (double)k * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
|
||||
|
||||
@@ -388,9 +388,9 @@ int main( int argc, char** argv )
|
||||
dtime_save = bli_clock_min_diff( dtime_save, dtime );
|
||||
}
|
||||
if ( bli_is_left( side ) )
|
||||
gflops = ( 1.0 * m * m * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( (double)m * (double)m * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
else
|
||||
gflops = ( 1.0 * m * n * n ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( (double)m * (double)n * (double)n ) / ( dtime_save * 1.0e9 );
|
||||
if ( bli_is_complex( dt ) ) gflops *= 4.0;
|
||||
#ifdef BLIS
|
||||
printf( "data_trsm_blis\t\t");
|
||||
|
||||
@@ -372,7 +372,7 @@ int main( int argc, char** argv )
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gflops = ( 1.0 * m * m ) / ( dtime_save * 1.0e9 );
|
||||
gflops = ( (double)m * (double)m ) / ( dtime_save * 1.0e9 );
|
||||
|
||||
#ifdef BLIS
|
||||
printf( "data_trsv_blis" );
|
||||
|
||||
Reference in New Issue
Block a user