186
* osl_relation_list_pprint_access_array_scoplib function:
187
* This function pretty-prints the elements of a osl_relation_list_t structure
188
* into a file (file, possibly stdout) in the SCoPLib format. I.e., it prints
189
* only the elements and not the number of elements. It prints an element of the
190
* list only if it is not NULL.
191
* \param file File where informations are printed.
192
* \param list The relation list whose information has to be printed.
193
* \param[in] names Array of constraint columns names.
194
* \param[in] add_fakeiter True of False
196
void osl_relation_list_pprint_access_array_scoplib(FILE * file,
197
osl_relation_list_p list, osl_names_p names, int add_fakeiter) {
199
int nb_rows_read = 0, nb_columns_read = 0;
200
int nb_rows_write = 0, nb_columns_write = 0;
201
int nb_rows_may_write = 0, nb_columns_may_write = 0;
202
osl_relation_list_p head ;
204
// Count the number of elements in the list with non-NULL content.
205
i = osl_relation_list_count(list);
207
// Print each element of the relation list.
210
// Read/Write arrays size
213
if (head->elt != NULL) {
214
if (head->elt->type == OSL_TYPE_READ) {
215
if (head->elt->nb_rows == 1)
218
nb_rows_read += head->elt->nb_rows - 1; // remove the 'Arr'
220
nb_columns_read = head->elt->nb_columns - head->elt->nb_output_dims;
222
} else if (head->elt->type == OSL_TYPE_WRITE) {
223
if (head->elt->nb_rows == 1)
226
nb_rows_write += head->elt->nb_rows - 1; // remove the 'Arr'
228
nb_columns_write = head->elt->nb_columns - head->elt->nb_output_dims;
230
} else if (head->elt->type == OSL_TYPE_MAY_WRITE) {
231
if (head->elt->nb_rows == 1)
234
nb_rows_may_write += head->elt->nb_rows - 1; // remove the 'Arr'
236
nb_columns_may_write = head->elt->nb_columns -
237
head->elt->nb_output_dims;
246
nb_columns_may_write++;
249
fprintf(file, "# Read access informations\n%d %d\n",
250
nb_rows_read, nb_columns_read);
253
if (head->elt != NULL && head->elt->type == OSL_TYPE_READ) {
254
osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter);
259
fprintf(file, "# Write access informations\n%d %d\n",
260
nb_rows_write, nb_columns_write);
263
if (head->elt != NULL && head->elt->type == OSL_TYPE_WRITE) {
264
osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter);
269
if (nb_rows_may_write > 0) {
270
fprintf(file, "# May Write access informations\n%d %d\n",
271
nb_rows_may_write, nb_columns_may_write);
274
if (head->elt != NULL && head->elt->type == OSL_TYPE_MAY_WRITE) {
275
osl_relation_pprint_scoplib(file, head->elt, names, 0, add_fakeiter);
282
fprintf(file, "# NULL relation list\n");
186
288
* osl_relation_list_pprint function:
187
289
* This function pretty-prints the content of a osl_relation_list_t structure
188
290
* into a file (file, possibly stdout) in the OpenScop format. It prints