OpenScop
0.9.0
|
00001 00002 /*+-----------------------------------------------------------------** 00003 ** OpenScop Library ** 00004 **-----------------------------------------------------------------** 00005 ** extensions/dependence.h ** 00006 **-----------------------------------------------------------------** 00007 ** First version: 02/07/2012 ** 00008 **-----------------------------------------------------------------** 00009 00010 00011 ***************************************************************************** 00012 * OpenScop: Structures and formats for polyhedral tools to talk together * 00013 ***************************************************************************** 00014 * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, * 00015 * / / / // // // // / / / // // / / // / /|,_, * 00016 * / / / // // // // / / / // // / / // / / / /\ * 00017 * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ * 00018 * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ * 00019 * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ * 00020 * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ * 00021 * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ * 00022 * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ * 00023 * | I | | | | e | | | | | | | | | | | | | \ \ \ * 00024 * | T | | | | | | | | | | | | | | | | | \ \ \ * 00025 * | E | | | | | | | | | | | | | | | | | \ \ \ * 00026 * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ * 00027 * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / * 00028 * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' * 00029 * * 00030 * Copyright (C) 2008 University Paris-Sud 11 and INRIA * 00031 * * 00032 * (3-clause BSD license) * 00033 * Redistribution and use in source and binary forms, with or without * 00034 * modification, are permitted provided that the following conditions * 00035 * are met: * 00036 * * 00037 * 1. Redistributions of source code must retain the above copyright notice, * 00038 * this list of conditions and the following disclaimer. * 00039 * 2. Redistributions in binary form must reproduce the above copyright * 00040 * notice, this list of conditions and the following disclaimer in the * 00041 * documentation and/or other materials provided with the distribution. * 00042 * 3. The name of the author may not be used to endorse or promote products * 00043 * derived from this software without specific prior written permission. * 00044 * * 00045 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * 00046 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * 00047 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * 00048 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * 00049 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * 00050 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * 00051 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * 00052 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * 00053 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * 00054 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 00055 * * 00056 * OpenScop Library, a library to manipulate OpenScop formats and data * 00057 * structures. Written by: * 00058 * Cedric Bastoul <Cedric.Bastoul@u-psud.fr> and * 00059 * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr> * 00060 * * 00061 *****************************************************************************/ 00062 00063 #ifndef OSL_DEPENDENCE_H 00064 # define OSL_DEPENDENCE_H 00065 00066 # include <stdio.h> 00067 # include <osl/interface.h> 00068 # include <osl/statement.h> 00069 # include <osl/relation.h> 00070 00071 # if defined(__cplusplus) 00072 extern "C" 00073 { 00074 # endif 00075 00076 00077 # define OSL_URI_DEPENDENCE "dependence" 00078 00079 # define OSL_DEPENDENCE_RAW 1 00080 # define OSL_DEPENDENCE_WAR 2 00081 # define OSL_DEPENDENCE_WAW 3 00082 # define OSL_DEPENDENCE_RAR 4 00083 # define OSL_DEPENDENCE_RAW_SCALPRIV 5 00084 00085 00086 # define OSL_DEPENDENCE_EQUAL 1 00087 # define OSL_DEPENDENCE_POSIT 2 00088 # define OSL_DEPENDENCE_LATER 3 00089 # define OSL_DEPENDENCE_NEVER 4 00090 00091 # define OSL_DEPENDENCE_ASSIGNMENT 1 00092 # define OSL_DEPENDENCE_P_REDUCTION 2 00093 # define OSL_DEPENDENCE_M_REDUCTION 3 00094 # define OSL_DEPENDENCE_T_REDUCTION 4 00095 00124 struct osl_dependence { 00125 int label_source; 00126 int label_target; 00127 int ref_source; 00128 int ref_target; 00129 int depth; 00130 int type; 00143 osl_relation_p domain; 00145 /* Other useful information */ 00146 00147 int source_nb_output_dims_domain; // (1) 00148 int source_nb_output_dims_access; // (2) 00149 00150 int target_nb_output_dims_domain; // (3) 00151 int target_nb_output_dims_access; // (4) 00152 00153 int source_nb_local_dims_domain; // (5) 00154 int source_nb_local_dims_access; // (6) 00155 int target_nb_local_dims_domain; // (7) 00156 int target_nb_local_dims_access; // (8) 00157 00158 void* usr; 00160 struct osl_dependence * next; 00162 /* These attributes are not filled by osl 00163 * You can use the function candl_dependence_init_fields of CandL 00164 */ 00165 00166 osl_relation_p ref_source_access_ptr; 00167 osl_relation_p ref_target_access_ptr; 00169 osl_statement_p stmt_source_ptr; 00170 osl_statement_p stmt_target_ptr; 00171 }; 00172 00173 typedef struct osl_dependence osl_dependence_t; 00174 typedef struct osl_dependence * osl_dependence_p; 00175 00176 00177 /*+*************************************************************************** 00178 * Structure display function * 00179 *****************************************************************************/ 00180 void osl_dependence_idump(FILE *, osl_dependence_p, int); 00181 void osl_dependence_dump(FILE *, osl_dependence_p); 00182 char * osl_dependence_sprint(osl_dependence_p); 00183 void osl_dependence_print(FILE *, osl_dependence_p); 00184 00185 00186 /***************************************************************************** 00187 * Reading function * 00188 *****************************************************************************/ 00189 osl_dependence_p osl_dependence_sread(char **); 00190 osl_dependence_p osl_dependence_psread(char **, int); 00191 00192 /*+*************************************************************************** 00193 * Memory allocation/deallocation function * 00194 *****************************************************************************/ 00195 osl_dependence_p osl_dependence_malloc(); 00196 void osl_dependence_free(osl_dependence_p); 00197 00198 /*+*************************************************************************** 00199 * Processing functions * 00200 *****************************************************************************/ 00201 osl_dependence_p osl_dependence_clone(osl_dependence_p); 00202 int osl_dependence_equal(osl_dependence_p, osl_dependence_p); 00203 void osl_dependence_add(osl_dependence_p*, osl_dependence_p*, 00204 osl_dependence_p); 00205 int osl_nb_dependences(osl_dependence_p); 00206 osl_interface_p osl_dependence_interface(); 00207 00208 # if defined(__cplusplus) 00209 } 00210 # endif 00211 00212 #endif /* define OSL_DEPENDENCE_H */