Changes between Version 7 and Version 8 of Orio/TuneSpecs


Ignore:
Timestamp:
06/13/08 07:51:59 (15 years ago)
Author:
hartono
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Orio/TuneSpecs

    v7 v8  
    3232 
    3333def input_vars { 
    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; 
     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; 
    3838} 
    3939}}} 
     
    5151== Declarations and Initializations of Input Variables == 
    5252 
    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. 
     53As 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.  
    5454 
     55 1. ''Both declarations and initializations are generated by the driver.'' 
     56{{{ 
     57def 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{{{ 
     63def 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{{{ 
     70def input_vars { 
     71  arg decl_file = 'decl_code.h'; 
     72  arg init_file = 'init_code.c'; 
     73} 
     74}}} 
     75 
     76The following is the content of the `decl_code.h` file. 
     77{{{ 
     78double X[N][N]; 
     79}}} 
     80 
     81And the code of the `init_code.c` file is displayed below. 
     82{{{ 
     83void 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}}} 
    5595 
    5696''Under construction''