2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: october 25th 2001 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
17 * This is free software; you can redistribute it and/or modify it under the *
18 * terms of the GNU General Public License as published by the Free Software *
19 * Foundation; either version 2 of the License, or (at your option) any later *
22 * This software is distributed in the hope that it will be useful, but *
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27 * You should have received a copy of the GNU General Public License along *
28 * with software; if not, write to the Free Software Foundation, Inc., *
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
31 * CLooG, the Chunky Loop Generator *
32 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 ******************************************************************************/
37 #ifndef CLOOG_PROGRAM_H
38 #define CLOOG_PROGRAM_H
39 #if defined(__cplusplus)
45 # define MAX_STRING 1024
46 # define MEGA 1000000 /* One million. */
50 * CloogProgram structure:
51 * this structure contains all the informations of a program generated or to be
55 { /* Basic program description fields. */
56 char _language
; /**< The language of the program. */
57 int _nb_scattdims
; /**< Scattering dimension number. */
58 CloogDomain
* _context
; /**< The context of the program. */
59 CloogLoop
* _loop
; /**< The loops of the program. */
60 CloogNames
* _names
; /**< Iterators and parameters names. */
61 CloogBlockList
* _blocklist
; /**< The statement block list. */
63 /* Internal service fields, filled up by cloog_program_scatter function. */
64 int * _scaldims
; /**< Boolean array saying whether a given
65 * scattering dimension is scalar or not.
67 /* Library user reserved field. */
68 void * usr
; /**< User field, for library user convenience.
69 * This pointer is not freed when the
70 * CloogProgram structure is freed.
73 typedef struct cloogprogram CloogProgram
;
76 static inline char cloog_program_language (CloogProgram
*p
)
81 static inline void cloog_program_set_language (CloogProgram
*p
, char c
)
86 static inline int cloog_program_nb_scattdims (CloogProgram
*p
)
88 return p
->_nb_scattdims
;
91 static inline void cloog_program_set_nb_scattdims (CloogProgram
*p
, int n
)
96 static inline CloogDomain
*cloog_program_context (CloogProgram
*p
)
101 static inline void cloog_program_set_context (CloogProgram
*p
, CloogDomain
*c
)
106 static inline CloogLoop
*cloog_program_loop (CloogProgram
*p
)
111 static inline void cloog_program_set_loop (CloogProgram
*p
, CloogLoop
*l
)
116 static inline CloogNames
*cloog_program_names (CloogProgram
*p
)
121 static inline void cloog_program_set_names (CloogProgram
*p
, CloogNames
*n
)
126 static inline CloogBlockList
*cloog_program_blocklist (CloogProgram
*p
)
128 return p
->_blocklist
;
131 static inline void cloog_program_set_blocklist (CloogProgram
*p
, CloogBlockList
*b
)
136 static inline int *cloog_program_scaldims (CloogProgram
*p
)
141 static inline void cloog_program_set_scaldims (CloogProgram
*p
, int *s
)
146 static inline int cloog_program_scaldim (CloogProgram
*p
, int i
)
148 return p
->_scaldims
[i
];
151 static inline void cloog_program_set_scaldim (CloogProgram
*p
, int i
, int k
)
156 /******************************************************************************
157 * Structure display function *
158 ******************************************************************************/
159 void cloog_program_print_structure(FILE *, CloogProgram
*, int) ;
160 void cloog_program_print(FILE *, CloogProgram
*) ;
161 void cloog_program_pprint(FILE *, CloogProgram
*, CloogOptions
*) ;
162 void cloog_program_dump_cloog(FILE *, CloogProgram
*) ;
165 /******************************************************************************
166 * Memory deallocation function *
167 ******************************************************************************/
168 void cloog_program_free(CloogProgram
*) ;
171 /******************************************************************************
173 ******************************************************************************/
174 CloogProgram
* cloog_program_read(FILE *, CloogOptions
*) ;
177 /******************************************************************************
178 * Processing functions *
179 ******************************************************************************/
180 CloogProgram
* cloog_program_malloc(void);
181 CloogProgram
* cloog_program_generate(CloogProgram
*, CloogOptions
*) ;
182 void cloog_program_block(CloogProgram
*, CloogDomainList
*) ;
183 void cloog_program_extract_scalars(CloogProgram
*program
, CloogDomainList
*) ;
184 void cloog_program_scatter(CloogProgram
*, CloogDomainList
*) ;
186 #if defined(__cplusplus)
189 #endif /* define _H */