Changes between Version 7 and Version 8 of Orio/TuneSpecs
- Timestamp:
- 06/13/08 07:51:59 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Orio/TuneSpecs
v7 v8 32 32 33 33 def input_vars { 34 decl dynamic double X[M] = 0;35 decl dynamic double Y[N] = random36 decl static double A[M][N] = random;37 decl double C = random;34 decl dynamic double X[M] = 0; 35 decl dynamic double Y[N] = random 36 decl static double A[M][N] = random; 37 decl double C = random; 38 38 } 39 39 }}} … … 51 51 == Declarations and Initializations of Input Variables == 52 52 53 As just mentioned before, all input variables involved in the core computation must be specified in the `input_vars` definition statement so that the performance testing driver can construct code for both the declarations and the initializations of the input variables. However, declarations and initializations of input variables can turn complicated, especially for multidimensional arrays with unique properties such as upper/lower triangular matrices and anti-symmetric matrices. As a consequence, Orio offers three alternatives to its users on how input variables can be declared and initialized accurately. 53 As just mentioned before, all input variables involved in the core computation must be specified in the `input_vars` definition statement so that the performance testing driver can construct code for both the declarations and the initializations of the input variables. However, declarations and initializations of input variables can turn complicated, especially for multidimensional arrays with unique properties such as upper/lower triangular matrices and anti-symmetric matrices. As a consequence, Orio offers three alternatives to its users on how input variables can be declared and initialized accurately. 54 54 55 1. ''Both declarations and initializations are generated by the driver.'' 56 {{{ 57 def input_vars { 58 decl static double X[N][N] = 0; 59 } 60 }}} 61 1. ''Declarations are generated by the driver. Initializations are written by the user.'' To be noted that all the declaration statements must have no initial assigned values. 62 {{{ 63 def input_vars { 64 decl static double X[N][N]; 65 arg init_file = 'init_code.c'; 66 } 67 }}} 68 1. ''Both declarations and initializations are written by the user.'' 69 {{{ 70 def input_vars { 71 arg decl_file = 'decl_code.h'; 72 arg init_file = 'init_code.c'; 73 } 74 }}} 75 76 The following is the content of the `decl_code.h` file. 77 {{{ 78 double X[N][N]; 79 }}} 80 81 And the code of the `init_code.c` file is displayed below. 82 {{{ 83 void init_input_vars() { 84 int i,j; 85 for (i=0; i<=N-1; i++) 86 for (j=0; j<=N-1; j++) 87 if (i < j) 88 X[i][j] = (i+j)%10 + 1; 89 else if (i == j) 90 X[i][j] = 1; 91 else 92 X[i][j] = 0; 93 } 94 }}} 55 95 56 96 ''Under construction''