Home | History | Annotate | Download | only in cloog
      1 
      2    /**-------------------------------------------------------------------**
      3     **                              CLooG                                **
      4     **-------------------------------------------------------------------**
      5     **                            program.h                              **
      6     **-------------------------------------------------------------------**
      7     **                 First version: october 25th 2001                  **
      8     **-------------------------------------------------------------------**/
      9 
     10 
     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 (at) inria.fr                         *
     34  *                                                                            *
     35  ******************************************************************************/
     36 
     37 
     38 #ifndef CLOOG_PROGRAM_H
     39 #define CLOOG_PROGRAM_H
     40 #if defined(__cplusplus)
     41 extern "C"
     42   {
     43 #endif
     44 
     45 
     46 # define MAX_STRING 1024
     47 # define MEGA 1000000  /* One million. */
     48 
     49 
     50 /**
     51  * CloogProgram structure:
     52  * this structure contains all the informations of a program generated or to be
     53  * generated.
     54  */
     55 struct cloogprogram
     56 { /* Basic program description fields. */
     57   char language ;              /**< The language of the program. */
     58   int  nb_scattdims ;          /**< Scattering dimension number. */
     59   CloogDomain    * context ;   /**< The context of the program. */
     60   CloogLoop      * loop ;      /**< The loops of the program. */
     61   CloogNames     * names ;     /**< Iterators and parameters names. */
     62   CloogBlockList * blocklist ; /**< The statement block list. */
     63 
     64   /* Internal service fields, filled up by cloog_program_scatter function. */
     65   int * scaldims ;             /**< Boolean array saying whether a given
     66                                 *   scattering dimension is scalar or not.
     67 				*/
     68   /* Library user reserved field. */
     69   void * usr;		       /**< User field, for library user convenience.
     70 			        *   This pointer is not freed when the
     71 			        *   CloogProgram structure is freed.
     72 			        */
     73 } ;
     74 typedef struct cloogprogram CloogProgram ;
     75 
     76 
     77 /******************************************************************************
     78  *                          Structure display function                        *
     79  ******************************************************************************/
     80 void cloog_program_print_structure(FILE *, CloogProgram *, int) ;
     81 void cloog_program_print(FILE *, CloogProgram *) ;
     82 void cloog_program_pprint(FILE *, CloogProgram *, CloogOptions *) ;
     83 void cloog_program_dump_cloog(FILE *, CloogProgram *, CloogScatteringList *);
     84 
     85 
     86 /******************************************************************************
     87  *                         Memory deallocation function                       *
     88  ******************************************************************************/
     89 void cloog_program_free(CloogProgram *) ;
     90 
     91 
     92 /******************************************************************************
     93  *                               Reading function                             *
     94  ******************************************************************************/
     95 CloogProgram * cloog_program_read(FILE *, CloogOptions *) ;
     96 
     97 
     98 /******************************************************************************
     99  *                            Processing functions                            *
    100  ******************************************************************************/
    101 CloogProgram * cloog_program_malloc(void);
    102 CloogProgram * cloog_program_alloc(CloogDomain *context, CloogUnionDomain *ud,
    103 	CloogOptions *options);
    104 CloogProgram * cloog_program_generate(CloogProgram *, CloogOptions *) ;
    105 void cloog_program_block(CloogProgram *program,
    106 	CloogScatteringList *scattering, CloogOptions *options);
    107 void cloog_program_extract_scalars(CloogProgram *program,
    108 	CloogScatteringList *scattering, CloogOptions *options);
    109 void cloog_program_scatter(CloogProgram *program,
    110 			CloogScatteringList *scattering, CloogOptions *options);
    111 
    112 #if defined(__cplusplus)
    113   }
    114 #endif
    115 #endif /* define _H */
    116 
    117