2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: april 19th 2003 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
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. *
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. *
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 *
32 * CLooG, the Chunky Loop Generator *
33 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
35 ******************************************************************************/
39 #ifndef CLOOG_OPTIONS_H
40 #define CLOOG_OPTIONS_H
41 #if defined(__cplusplus)
47 /* Uncomment the following line if you want some information about
48 * maximum total allocated memory for code generation.
54 typedef struct cloogoptions CloogOptions
;
58 CloogState
*state
; /* State. */
59 /* OPTIONS FOR LOOP GENERATION */
60 int l
; /* Last level to optimize. */
61 int f
; /* First level to optimize. */
62 int stop
; /* Level to stop code generation. */
63 int strides
; /* 1 if user wants to handle non-unit strides (then loop
64 * increment can be something else than one), 0 otherwise.
66 int sh
; /* 1 for computing simple hulls */
69 /* OPTIONS FOR PRETTY PRINTING */
70 int esp
; /* 1 if user wants to spread all equalities, i.e. when there
71 * is something like "i = 3*j + 1 ; A[i] = 0 ;" the generator
72 * will write "A[3*j + 1] = 0 ;", 0 otherwise.
74 int fsp
; /* The iteration level where equalities spreading can begin
75 * (it might happen that the user wants not to spread values
76 * of scattering iterators).
78 int otl
; /* 1 for eliminate loops running just one time and write them
79 * as an affectation of the iterator, 0 otherwise.
81 int block
; /* 1 to make one new block {...} per new dimension,
84 int compilable
; /* 1 to generate a compilable code by using
85 * preprocessing, 0 otherwise.
87 int callable
; /* 1 to generate callable code by using
88 * preprocessing, 0 otherwise.
90 int language
; /* 1 to generate FORTRAN, 0 for C otherwise. */
92 int save_domains
;/* Save unsimplified copy of domain. */
95 char * name
; /* Name of the input file. */
96 float time
; /* Time spent for code generation in seconds. */
98 int memory
; /* Memory spent for code generation in kilobytes. */
100 int quiet
; /* Don't print any informational messages. */
101 /* UNDOCUMENTED OPTIONS FOR THE AUTHOR ONLY */
102 int leaks
; /* 1 if I want to print the allocation statistics,
105 int backtrack
; /* 1 to perform backtracking in
106 * Quillere's algorithm, 0 otherwise.
108 int override
; /* 1 if I want to bypass CLooG decisions on option correctness
109 * (generated code may be incorrect), 0 otherwise.
111 int structure
; /* 1 if I want to print the CloogProgram structure before the
112 * pretty printed code, 0 otherwise.
114 int noblocks
; /* 1 if I don't want to make statement blocks, 0 otherwise. */
115 int noscalars
; /* 1 if I don't want to use scalar dimensions, 0 otherwise. */
116 int nosimplify
; /* 1 if I don't want to simplify polyhedra, 0 otherwise. */
120 /******************************************************************************
121 * Error reporting functions *
122 ******************************************************************************/
124 enum cloog_msg_type
{ CLOOG_ERROR
, CLOOG_WARNING
, CLOOG_INFO
};
126 void cloog_msg(CloogOptions
*options
, enum cloog_msg_type type
,
127 const char *msg
, ...);
128 void cloog_die(const char *msg
, ...);
131 /******************************************************************************
132 * Structure display function *
133 ******************************************************************************/
134 void cloog_options_print(FILE *, CloogOptions
*) ;
137 /******************************************************************************
138 * Memory deallocation function *
139 ******************************************************************************/
140 void cloog_options_free(CloogOptions
*) ;
143 /******************************************************************************
145 ******************************************************************************/
146 void cloog_options_read(CloogState
*state
, int argc
, char **argv
,
147 FILE **input
, FILE **output
, CloogOptions
**options
);
150 /******************************************************************************
151 * Processing functions *
152 ******************************************************************************/
153 CloogOptions
*cloog_options_malloc(CloogState
*state
);
156 #if defined(__cplusplus)
159 #endif /* define _H */