Clan
0.8.1
|
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <osl/vector.h>
#include <osl/relation.h>
#include <osl/relation_list.h>
#include <osl/statement.h>
#include <osl/strings.h>
#include <osl/extensions/scatnames.h>
#include <osl/extensions/arrays.h>
#include <osl/extensions/coordinates.h>
#include <osl/extensions/clay.h>
#include <osl/extensions/extbody.h>
#include <osl/generic.h>
#include <osl/body.h>
#include <osl/scop.h>
#include <source/parser.h>
#include <clan/macros.h>
#include <clan/options.h>
#include <clan/relation.h>
#include <clan/statement.h>
#include <clan/scop.h>
Go to the source code of this file.
Functions | |
osl_scop_p | clan_parse (FILE *, clan_options_p) |
osl_scop_p | clan_scop_extract (FILE *input, clan_options_p options) |
void | clan_scop_compact (osl_scop_p scop) |
void | clan_scop_print (FILE *file, osl_scop_p scop, clan_options_p options) |
void | clan_scop_generate_scatnames (osl_scop_p scop) |
void | clan_scop_generate_coordinates (osl_scop_p scop, char *name) |
void | clan_scop_generate_clay (osl_scop_p scop, char *script) |
void | clan_scop_update_coordinates (osl_scop_p scop, int coordinates[5][CLAN_MAX_SCOPS]) |
void | clan_scop_print_autopragma (FILE *input, int nb_scops, int coordinates[5][CLAN_MAX_SCOPS]) |
static int | clan_scop_no_pragma (char *filename, int line_start) |
void | clan_scop_insert_pragmas (osl_scop_p scop, char *filename, int test) |
void | clan_scop_simplify (osl_scop_p scop) |
Variables | |
int | scanner_scop_start |
int | scanner_scop_end |
int | parser_indent |
osl_scop_p clan_parse | ( | FILE * | , |
clan_options_p | |||
) |
Referenced by clan_scop_extract().
void clan_scop_compact | ( | osl_scop_p | scop | ) |
clan_scop_compact function: This function scans the SCoP to put the right number of columns to every relation (during construction we used CLAN_MAX_DEPTH and CLAN_MAX_PARAMETERS to define relation and vector sizes).
scop | The scop to scan to compact matrices. |
Definition at line 96 of file scop.c.
References clan_statement_compact().
osl_scop_p clan_scop_extract | ( | FILE * | input, |
clan_options_p | options | ||
) |
clan_scop_extract function: this function is a wrapper to the clan_parse function that parses a file to extract a SCoP and returns, if successful, a pointer to the osl_scop_t structure.
input | The file to parse (already open). |
options | Options for file parsing. |
Definition at line 84 of file scop.c.
References clan_parse().
Referenced by main().
void clan_scop_generate_clay | ( | osl_scop_p | scop, |
char * | script | ||
) |
void clan_scop_generate_coordinates | ( | osl_scop_p | scop, |
char * | name | ||
) |
clan_scop_generate_coordinates function: this function generates a coordinates extension for the scop passed as an argument.
[in] | name | The name of the SCoP original file. |
[in,out] | scop | The scop to add a scatnames extension to. |
Definition at line 218 of file scop.c.
References parser_indent, scanner_scop_end, and scanner_scop_start.
void clan_scop_generate_scatnames | ( | osl_scop_p | scop | ) |
clan_scop_generate_scatnames function: this function generates a scatnames extension for the scop passed as an argument. Since Clan use a "2d+1" scattering strategy, the scattering dimension names are generated by reusing the original iterator names of the deepest statement and by inserting between those names some beta vector elements (the Xth beta element is called bX).
[in,out] | scop | The scop to add a scatnames extension to. |
void clan_scop_insert_pragmas | ( | osl_scop_p | scop, |
char * | filename, | ||
int | test | ||
) |
clan_scop_insert_pragmas function: inserts "#pragma scop" and "#pragma endscop" in a source file around the SCoPs related in the input SCoP list that have no surrounding pragmas in the file.
[in] | scop | The list of SCoPS. |
[in] | filename | Name of the file where to insert pragmas. |
[in] | test | 0 to insert, 1 to leave the result in the CLAN_AUTOPRAGMA_FILE temporary file. |
Definition at line 427 of file scop.c.
References clan_scop_no_pragma(), and clan_scop_print_autopragma().
Referenced by main().
|
static |
clan_scop_no_pragma function: this function returns CLAN_FALSE if there is a "#pragma scop" at the beginning of the line number "line_start" of the file "filename", CLAN_TRUE otherwise.
[in] | filename | Name of the file to be checked. |
[in] | line_start | Line number to check. |
Definition at line 372 of file scop.c.
Referenced by clan_scop_insert_pragmas().
void clan_scop_print | ( | FILE * | file, |
osl_scop_p | scop, | ||
clan_options_p | options | ||
) |
clan_scop_print function: this function prints the content of an osl_scop_t structure (*scop) into a file (file, possibly stdout) in the OpenScop textual format.
[in] | file | The file where the information has to be printed. |
[in] | scop | The scop structure whose information has to be printed. |
[in] | options | Clan's general option settings. |
Definition at line 109 of file scop.c.
References clan_options::castle, and clan_options::outscoplib.
Referenced by main().
void clan_scop_print_autopragma | ( | FILE * | input, |
int | nb_scops, | ||
int | coordinates[5][CLAN_MAX_SCOPS] | ||
) |
clan_scop_print_autopragma function: this function prints a copy of the input file 'input' to a file named by the CLAN_AUTOPRAGMA_FILE macro, where the SCoP pragmas for 'nb_scops' SCoPs are inserted according to the coordinates array. The rows of the coordinates array have the following meaning: 0: line start, 1: line end, 2: column start, 3: column end, 4: boolean set to 1 for an auto-discovered scop, 0 for user-scop.
[in] | input | The input stream (must be open). |
[in] | nb_scops | The number of scops. |
[in] | coordinates | The array of coordinates for each SCoPs. |
Definition at line 313 of file scop.c.
Referenced by clan_scop_insert_pragmas().
void clan_scop_simplify | ( | osl_scop_p | scop | ) |
clan_scop_simplify function: this function tries to simplify the iteration domains of the SCoP. /param[in,out] scop SCoP to simplify (updated).
Definition at line 499 of file scop.c.
References clan_relation_simplify().
void clan_scop_update_coordinates | ( | osl_scop_p | scop, |
int | coordinates[5][CLAN_MAX_SCOPS] | ||
) |
clan_scop_update_coordinates function: this function replaces the values in the coordinates extension of each SCoP of the list 'scop' by those in the 'coordinates' array. The rows of the coordinates array have the following meaning: 0: line start, 1: line end, 2: column start, 3: column end, 4: boolean set to 1 for an auto-discovered scop, 0 for user-scop. The ith column of the coordinates array describes the coordinates of the ith SCoP.
[in,out] | scop | SCoP list to update the coordinates. |
[in] | coordinates | Array of coordinates. |
int parser_indent |
Referenced by clan_scop_generate_coordinates().
int scanner_scop_end |
Referenced by clan_scop_generate_coordinates().
int scanner_scop_start |
Referenced by clan_scop_generate_coordinates().