[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.4.11 Compilable Code -compilable <value>
-compilable <value>
: this options allows (value
is not 0)
to generate a compilable code where all parameters have the integral value
value
. This option creates a macro for each statement. Since
CLooG do not know anything about the statement sources, it fills the
macros with a basic increment that computes the total number of
scanned integral points. The user may change easily the macros according
to his own needs. This option is possible only if the generated code is
in C. Default value is 0.
/* Generated using a given input file and option -compilable 0 */ for (i=0;i<=n;i++) { for (j=0;j<=n;j++) { S1 ; S2 ; } S3 ; }
/* Generated using the same input file but option -compilable 10 */ /* DON'T FORGET TO USE -lm OPTION TO COMPILE. */ /* Useful headers. */ #include <stdio.h> #include <stdlib.h> #include <math.h> /* Parameter value. */ #define PARVAL 10 /* Statement macros (please set). */ #define S1(i,j) {total++;} #define S2(i,j) {total++;} #define S3(i) {total++;} int main() { /* Original iterators. */ int i, j ; /* Parameters. */ int n=PARVAL, total=0 ; for (i=0;i<=n;i++) { for (j=0;j<=n;j++) { S1(i,j) ; S2(i,j) ; } S3(i) ; } printf("Number of integral points: %d.\n",total) ; return 0 ; }
This document was generated on August 20, 2013 using texi2html 5.0.