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:
- 9:54628dc6805e
- Parent:
- 8:66f6deeb2556
- Child:
- 10:7473e1529a9e
--- a/main.cpp Tue Jan 03 22:29:43 2017 +0000
+++ b/main.cpp Sun Apr 09 20:01:47 2017 +0000
@@ -1,7 +1,7 @@
//********************************************************
-//** BETA---------------
+//** BETA--------------- ******
//** Nucleo-144 Stm32F746 and Stm32F767 benchmark ******
-//** Limpack -port form Arduino IDE *****
+//** Limpack -port form Arduino IDE ******
//** Jovan Ivkovic - 2016 ******
//********************************************************
#include "mbed.h"
@@ -12,7 +12,8 @@
# include <math.h>
DigitalOut myled(LED1);
-Serial pc(USBTX, USBRX);
+Serial pc(USBTX, USBRX); //USB is out of oreder on Embeded-Pi
+//Serial pc(PC_10,PC_11); //RX-TX D0,D1 Embeded-PI ports
Timer timer;
int do_benchmark( void );
@@ -45,8 +46,8 @@
int main()
{
- pc.baud(115200);
- //pc.baud(9600);
+ //pc.baud(115200);
+ pc.baud(9600);
while(1) {
@@ -82,14 +83,14 @@
N is the problem size.
*/
-# define N 2
+# define N 40
# define LDA ( N + 1 )
- //static double a[90];
+ // static double a[90];
static double *a;
static double a_max;
- //static double b[9];
- static double *b;
+ static double b[41];
+ //static double *b;
static double b_max;
const double cray = 0.056;
static double eps;
@@ -120,8 +121,10 @@
pc.printf ( " Leading matrix dimension LDA = %d\n", LDA );
// ops = ( double ) ( 2 * N * N * N ) / 3.0 + 2.0 * ( double ) ( N * N );
- ops = ( double ) ( 2L * N * N * N ) / 3.0 + 2.0 * ( double ) ( (long)N * N ); // Arduino C
-
+ //ops = ( double ) ( 2L * N * N * N ) / 3.0 + 2.0 * ( double ) ( (long)N * N ); // Arduino C
+
+ ops = (2.0e0*(N*N*N))/3.0 + 2.0*(N*N);
+ //ops = ops * 5; // loop multiply
/*
Allocate space for arrays.
*/
@@ -146,14 +149,16 @@
}
}
+ //int ii = 0;
timer.start();
//*****************
- t1 = ( double ) timer.read_us() / 1000000.0;
-
- info = dgefa ( a, LDA, N, ipvt );
-
- t2 = ( double ) timer.read_us() / 1000000.0;
+ t1 = timer.read();
+
+ //for(ii = 0; ii <= 4; ii++) { // x5
+ info = dgefa ( a, LDA, N, ipvt );
+ //}
+ t2 = timer.read();
if ( info != 0 ) {
pc.printf ( "\n" );
@@ -169,12 +174,14 @@
//*********
- t1 = ( double ) timer.read_us() / 1000000.0;
-
- job = 0;
- dgesl ( a, LDA, N, ipvt, b, job );
-
- t2 = ( double ) timer.read_us() / 1000000.0;
+ t1 = timer.read();
+
+ //for(ii = 0; ii <= 4; ii++) { // x5
+ job = 0;
+ dgesl ( a, LDA, N, ipvt, b, job );
+ //}
+
+ t2 = timer.read();
time[1] = t2 - t1;
total = time[0] + time[1];
@@ -253,8 +260,9 @@
pc.printf( " Factor Solve Total MFLOPS Unit Cray-Ratio \n\n" );
for(int ii=0; ii<6; ii++) {
- pc.printf(" %9f", time[ii]);
+ pc.printf(" %9.6f", time[ii]);
}
+ wait(1);
//pc.printf( " %9f %9f %9f %9f %9f %9f\n", time[0], time[1], time[2], time[3], time[4], time[5] );