Add OpenScop support
[cloog/uuh.git] / include / cloog / options.h
blobb3816502f7f2ca1a36510ae3be3def269f82bd0a
2 /**-------------------------------------------------------------------**
3 ** CLooG **
4 **-------------------------------------------------------------------**
5 ** options.h **
6 **-------------------------------------------------------------------**
7 ** First version: april 19th 2003 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
14 * *
15 * Copyright (C) 2001-2005 Cedric Bastoul *
16 * *
17 * This library is free software; you can redistribute it and/or *
18 * modify it under the terms of the GNU Lesser General Public *
19 * License as published by the Free Software Foundation; either *
20 * version 2.1 of the License, or (at your option) any later version. *
21 * *
22 * This library is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
25 * Lesser General Public License for more details. *
26 * *
27 * You should have received a copy of the GNU Lesser General Public *
28 * License along with this library; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
30 * Boston, MA 02110-1301 USA *
31 * *
32 * CLooG, the Chunky Loop Generator *
33 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 * *
35 ******************************************************************************/
37 #include <stdio.h>
39 #ifndef CLOOG_OPTIONS_H
40 #define CLOOG_OPTIONS_H
41 #if defined(__cplusplus)
42 extern "C"
44 #endif
47 /* Uncomment the following line if you want some information about
48 * maximum total allocated memory for code generation.
49 #define CLOOG_MEMORY
51 #define CLOOG_SCALARS
53 struct osl_scop;
55 struct cloogoptions;
56 typedef struct cloogoptions CloogOptions;
58 struct cloogoptions
60 CloogState *state; /* State. */
61 /* OPTIONS FOR LOOP GENERATION */
62 int l ; /* Last level to optimize. */
63 int f ; /* First level to optimize. */
64 int stop ; /* Level to stop code generation. */
65 int strides ; /* 1 if user wants to handle non-unit strides (then loop
66 * increment can be something else than one), 0 otherwise.
68 int sh; /* 1 for computing simple hulls */
69 int first_unroll; /* The first dimension to unroll */
71 /* OPTIONS FOR PRETTY PRINTING */
72 int esp ; /* 1 if user wants to spread all equalities, i.e. when there
73 * is something like "i = 3*j + 1 ; A[i] = 0 ;" the generator
74 * will write "A[3*j + 1] = 0 ;", 0 otherwise.
76 int fsp ; /* The iteration level where equalities spreading can begin
77 * (it might happen that the user wants not to spread values
78 * of scattering iterators).
80 int otl ; /* 1 for eliminate loops running just one time and write them
81 * as an affectation of the iterator, 0 otherwise.
83 int block ; /* 1 to make one new block {...} per new dimension,
84 * 0 otherwise.
86 int compilable; /* 1 to generate a compilable code by using
87 * preprocessing, 0 otherwise.
89 int callable; /* 1 to generate callable code by using
90 * preprocessing, 0 otherwise.
92 int language; /* 1 to generate FORTRAN, 0 for C otherwise. */
94 int save_domains;/* Save unsimplified copy of domain. */
96 /* MISC OPTIONS */
97 char * name ; /* Name of the input file. */
98 float time ; /* Time spent for code generation in seconds. */
99 int openscop; /* 1 if the input file has OpenScop format, 0 otherwise. */
100 #ifdef CLOOG_MEMORY
101 int memory ; /* Memory spent for code generation in kilobytes. */
102 #endif
103 int quiet; /* Don't print any informational messages. */
104 /* UNDOCUMENTED OPTIONS FOR THE AUTHOR ONLY */
105 int leaks ; /* 1 if I want to print the allocation statistics,
106 * 0 otherwise.
108 int backtrack; /* 1 to perform backtracking in
109 * Quillere's algorithm, 0 otherwise.
111 int override ; /* 1 if I want to bypass CLooG decisions on option correctness
112 * (generated code may be incorrect), 0 otherwise.
114 int structure ; /* 1 if I want to print the CloogProgram structure before the
115 * pretty printed code, 0 otherwise.
117 int noblocks ; /* 1 if I don't want to make statement blocks, 0 otherwise. */
118 int noscalars ; /* 1 if I don't want to use scalar dimensions, 0 otherwise. */
119 int nosimplify; /* 1 if I don't want to simplify polyhedra, 0 otherwise. */
123 /******************************************************************************
124 * Error reporting functions *
125 ******************************************************************************/
127 enum cloog_msg_type { CLOOG_ERROR, CLOOG_WARNING, CLOOG_INFO };
129 void cloog_msg(CloogOptions *options, enum cloog_msg_type type,
130 const char *msg, ...);
131 void cloog_die(const char *msg, ...);
134 /******************************************************************************
135 * Structure display function *
136 ******************************************************************************/
137 void cloog_options_print(FILE *, CloogOptions *) ;
140 /******************************************************************************
141 * Memory deallocation function *
142 ******************************************************************************/
143 void cloog_options_free(CloogOptions *) ;
146 /******************************************************************************
147 * Reading function *
148 ******************************************************************************/
149 void cloog_options_read(CloogState *state, int argc, char **argv,
150 FILE **input, FILE **output, CloogOptions **options);
153 /******************************************************************************
154 * Processing functions *
155 ******************************************************************************/
156 CloogOptions *cloog_options_malloc(CloogState *state);
157 void cloog_options_copy_from_osl_scop(struct osl_scop *, CloogOptions *);
160 #if defined(__cplusplus)
162 #endif
163 #endif /* define _H */