Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 5:2b929fbd5c69
- Parent:
- 4:557ad9613c6e
- Child:
- 6:5e0f3eedaf66
diff -r 557ad9613c6e -r 2b929fbd5c69 main.cpp
--- a/main.cpp Tue Jan 03 14:24:52 2017 +0000
+++ b/main.cpp Tue Jan 03 18:41:10 2017 +0000
@@ -48,12 +48,12 @@
pc.baud(115200);
//pc.baud(9600);
- while(1) {
-
+ while(1)
+ {
pc.printf("Starting benchmark...\n");
-
+
do_benchmark();
-
+
pc.printf(" kraj \n\n");
}
}
@@ -119,7 +119,8 @@
pc.printf ( " Matrix order N = %d\n", N );
pc.printf ( " Leading matrix dimension LDA = %d\n", LDA );
- ops = ( double ) ( 2L * N * N * N ) / 3 + 2 * ( N * N );
+ ops = ( double ) (( 2 * N * N * N ) / 3.0 ) + 2.0 * ( N * N )); //c++
+ //ops = ( double ) ( 2L * N * N * N ) / 3.0 + 2.0 * ( double ) ( (long)N * N ); // Arduiono C
/*
Allocate space for arrays.
@@ -219,6 +220,7 @@
eps = r8_epsilon ( );
residn = resid_max / ( double ) N / a_max / b_max / eps;
+
time[2] = total;
@@ -249,7 +251,7 @@
//pc.printf( " %14f %14f %14e %14f %14f \n", residn, resid_max, eps, b[0], b[N-1] );
pc.printf( " \n\n ");
- pc.printf( " Factor Solve Total MFLOPS Unit Cray-Ratio \n\n" );
+ pc.printf( " Factor Solve Total MFLOPS Unit Cray-Ratio \n\n" );
for(int ii=0; ii<6; ii++) {
pc.printf(" %9f", time[ii]);
@@ -259,7 +261,15 @@
/*
Terminate.
+ free mem
*/
+ free ( a );
+ free ( b );
+ free ( ipvt );
+ free ( resid );
+ free ( rhs );
+ free ( x );
+
pc.printf( "\n" );
pc.printf( "LINPACK_BENCH\n" );
pc.printf( " Normal end of execution.\n" );