1 | /* --------------- */ |
---|
2 | /* --- mutil.h --- */ |
---|
3 | /* --------------- */ |
---|
4 | |
---|
5 | #ifndef __MUTIL_H__ |
---|
6 | #define __MUTIL_H__ |
---|
7 | |
---|
8 | #ifdef __cplusplus |
---|
9 | #pragma message ("C++") |
---|
10 | extern "C" { |
---|
11 | #endif |
---|
12 | |
---|
13 | #define RUN 5 |
---|
14 | #define FREQ 2.4e9 |
---|
15 | |
---|
16 | //#define CHRONO(X,t) tmin = 1e10; for(r=0; r<run; r++) { t0 = chrono(); for(i=0;i<iter;i++) X; t1 = chrono(); dt = t1-t0; if(dt<tmin) tmin = dt; } t = tmin*FREQ/(iter*n*n) |
---|
17 | #define CHRONO(X,t) tmin = 1e10; for(r=0; r<run; r++) { t0 = chrono(); for(i=0;i<iter;i++) X; t1 = chrono(); dt = t1-t0; if(dt<tmin) tmin = dt; } t = tmin/iter |
---|
18 | //#define CHRONO(X,t) tmin = 1e10; for(r=0; r<run; r++) { t0 = chrono(); for(i=0;i<iter;i++) X; t1 = chrono(); dt = t1-t0; if(dt<tmin) tmin = dt; } t=tmin/iter |
---|
19 | |
---|
20 | float32 forceCalc(float32 **X, int i0, int i1, int j0, int j1); |
---|
21 | |
---|
22 | double cpp(double t, int n); |
---|
23 | |
---|
24 | double cp0DotProduct (double t, int n); |
---|
25 | double cp0Euclide (double t, int n); |
---|
26 | double cp0Manhattan (double t, int n); |
---|
27 | double cp0Mahalanobis (double t, int n); |
---|
28 | |
---|
29 | double mflopsDotProduct (double t, int n); |
---|
30 | double mflopsEuclide (double t, int n); |
---|
31 | double mflopsManhattan (double t, int n); |
---|
32 | double mflopsMahalanobis(double t, int n); |
---|
33 | double mflopsMul (double t, int n); |
---|
34 | |
---|
35 | uint8 ui8rand(void); |
---|
36 | uint32 ui32rand(void); |
---|
37 | uint32 f32rand(void); |
---|
38 | |
---|
39 | void rand_ui8vector(uint8 *X, int i0, int i1); |
---|
40 | void rand_ui32vector(uint32 *X, int i0, int i1); |
---|
41 | void rand_f32vector(float32 *X, int i0, int i1); |
---|
42 | |
---|
43 | int getIter(int size); |
---|
44 | int getIterAV(int size); |
---|
45 | |
---|
46 | float32 gauss(float32 sigma, float32 x); |
---|
47 | |
---|
48 | |
---|
49 | #ifdef __cplusplus |
---|
50 | } |
---|
51 | #endif |
---|
52 | |
---|
53 | #endif /* __MUTIL_H__ */ |
---|