diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-30 21:16:10 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-30 21:16:10 +0000 |
commit | 8c4b14b0ff2387b3a5fd8fb7cd91ce5d86b10ac1 (patch) | |
tree | 6feb4aded8057ea7f65b1e0847fd6c2f973acaae /gcc/graphite-cloog-util.c | |
parent | 2006b4537145bf98d9b2e1026eb74f855d3003c8 (diff) | |
download | gcc-8c4b14b0ff2387b3a5fd8fb7cd91ce5d86b10ac1.tar.gz |
Write OpenScop format.
2010-07-29 Riyadh Baghdadi <baghdadi.mr@gmail.com>
* graphite-cloog-util.c (openscop_print_cloog_matrix): New.
(openscop_print_polyhedron_matrix): New.
* graphite-cloog-util.h (openscop_print_polyhedron_matrix): Declared.
* graphite-poly.c (openscop_print_pdr_polyhedron): Same.
(openscop_print_pdr_powerset): New.
(openscop_print_powerset_matrix): New.
(openscop_print_scattering_function_1): New.
(print_scattering_function): Add support for scattering names and
OpenScop format.
(graphite_write_transforms): Remove.
(apply_poly_transforms): Updated to call print_scop.
(print_pdr_access_layout): Updated to support OpenScop format.
(print_pdr): Same.
(openscop_print_pbb_domain): New.
(print_pbb_body): Added a parameter to allow indicating that pbb_body is
not provided.
(print_pbb): Updated to call the new print_pbb_body.
(openscop_print_scop_context): New.
(print_scop_header): New.
(print_scop): Updated to call print_scop_header.
* graphite-poly.h: Document OpenScop format.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164770 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-cloog-util.c')
-rw-r--r-- | gcc/graphite-cloog-util.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c index 17704580bc0..0bb5d742586 100644 --- a/gcc/graphite-cloog-util.c +++ b/gcc/graphite-cloog-util.c @@ -296,4 +296,43 @@ new_Cloog_Domain_from_ppl_Pointset_Powerset return res; } + +/* Print to FILE the matrix MAT in OpenScop format. OUTPUT is the number + of output dimensions, INPUT is the number of input dimensions, LOCALS + is the number of existentially quantified variables and PARAMS is the + number of parameters. */ + +static void +openscop_print_cloog_matrix (FILE *file, CloogMatrix *mat, + int output, int input, int locals, + int params) +{ + int i, j; + + fprintf (file, "%d %d %d %d %d %d \n", cloog_matrix_nrows (mat), + cloog_matrix_ncolumns (mat), output, input, locals, params); + + for (i = 0; i < cloog_matrix_nrows (mat); i++) + { + for (j = 0; j < cloog_matrix_ncolumns (mat); j++) + fprintf (file, "%6ld ", mpz_get_si (mat->p[i][j])); + fprintf (file, "\n"); + } +} + +/* Print to FILE the polyhedron PH in OpenScop format. OUTPUT is the number + of output dimensions, INPUT is the number of input dimensions, LOCALS is + the number of existentially quantified variables and PARAMS is the number + of parameters. */ + +void +openscop_print_polyhedron_matrix (FILE *file, ppl_const_Polyhedron_t ph, + int output, int input, int locals, + int params) +{ + CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph); + openscop_print_cloog_matrix (file, mat, output, input, locals, params); + cloog_matrix_free (mat); +} + #endif |