[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.2 Writing The Input File
The input text file contains a problem description, i.e. the context, the domains and the scattering functions. Because CLooG is very ’compilable code generation oriented’, we can associate some additional informations to each domain. We call this association a statement. The set of all informations is called a program. The input file respects the grammar below (terminals are preceded by "_"):
File ::= Program Program ::= Context Statements Scattering Context ::= Language Domain_union Naming Statements ::= Nb_statements Statement_list Naming Scatterings ::= Nb_functions Scattering_list Naming Naming ::= Option Name_list Name_list ::= _String Name_list | (void) Statement_list ::= Statement Statement_list | (void) Domain_list ::= _Domain Domain_list | (void) Scattering_list ::= Domain_union Scattering_list | (void) Statement ::= Iteration_domain 0 0 0 Iteration_domain ::= Domain_union Domain_union ::= Nb_domains Domain_list Option ::= 0 | 1 Language ::= c | f Nb_statements ::= _Integer Nb_domains ::= _Integer Nb_functions ::= _Integer
Note: if there is only one domain in a ‘Domain_union’, i.e., if ‘Nb_domains’ is 1, then this 1 may be omitted.
- ‘Context’ represents the informations that are shared by all the statements. It consists on the language used (which can be ‘c’ for C or ‘f’ for FORTRAN 90) and the global constraints on parameters. These constraints are essential since they give to CLooG the number of parameters. If there is no parameter or no constraints on parameters, just give a constraint always satisfied like 1 \geq 0. ‘Naming’ sets the parameter names. If the naming option ‘Option’ is 1, parameter names will be read on the next line. There must be exactly as many names as parameters. If the naming option ‘Option’ is 0, parameter names are automatically generated. The name of the first parameter will be ‘M’, and the name of the (n+1)^{th} parameter directly follows the name of the n^{th} parameter in ASCII code. It is the user responsibility to ensure that parameter names, iterators and scattering dimension names are different.
- ‘Statements’ represents the informations on the statements. ‘Nb_statements’ is the number of statements in the program, i.e. the number of ‘Statement’ items in the ‘Statement_list’. ‘Statement’ represents the informations on a given statement. To each statement is associated a domain (the statement iteration domain: ‘Iteration_domain’) and three zeroes that represents future options. ‘Naming’ sets the iterator names. If the naming option ‘Option’ is 1, the iterator names will be read on the next line. There must be exactly as many names as nesting level in the deepest iteration domain. If the naming option ‘Option’ is 0, iterator names are automatically generated. The iterator name of the outermost loop will be ‘i’, and the iterator name of the loop at level n+1 directly follows the iterator name of the loop at level n in ASCII code.
- ‘Scatterings’ represents the informations on scattering functions. ‘Nb_functions’ is the number of functions (it must be equal to the number of statements or 0 if there is no scattering function). The functions themselves are represented through ‘Scattering_list’. ‘Naming’ sets the scattering dimension names. If the naming option ‘Option’ is 1, the scattering dimension names will be read on the next line. There must be exactly as many names as scattering dimensions. If the naming option ‘Option’ is 0, scattering dimension names are automatically generated. The name of the n^{th} scattering dimension will be ‘cn’.
2.2.1 Domain Representation | ||
2.2.2 Scattering Function Representation |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on August 20, 2013 using texi2html 5.0.