6 #include "pips_config.h"
25 #include "resources.h"
46 int len = strlen(bad_prefix);
47 if(strncasecmp(
full_name,bad_prefix,len)==0) {
66 const char * clean_mod_name = mod_name;
72 return clean_mod_name;
79 const char *mod_name) {
106 static entity get_coordinate_intrinsic(
int coordinate) {
114 return coord_intrinsic;
130 parallel_loop_nest_depth);
133 if (parallel_loop_nest_depth > 0) {
208 bool old_outline_independent_compilation_unit =
233 for(
int i =
depth - 1; i >= 0; i--) {
253 string intrinsic_name;
276 free(intrinsic_name);
299 string source_file_name =
324 pips_debug(1,
"Outline Fortan_wrapper with prefix %s\n", fwp);
333 old_outline_independent_compilation_unit);
350 "GPU_IFY_DEBUG_LEVEL");
statement outliner(const char *, list)
outline the statements in statements_to_outline into a module named outline_module_name the outlined ...
static statement module_statement
entity FindOrMakeDefaultIntrinsic(string name, int arity)
Create a default intrinsic.
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
const char * global_name_to_user_name(const char *global_name)
functions on strings for entity names
char * get_string_property(const char *)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
#define gen_recurse(start, domain_number, flt, rwt)
static const char * launcher_prefix
static const char * wrapper_prefix
static const char * clean_prefix(const char *full_name, const char *bad_prefix)
Return a pointer on the first char after the bad_prefix.
static const char * get_clean_mod_name(const char *mod_name)
Trying to get only the original function name without prefix.
static const char * fwrapper_prefix
static const char * kernel_prefix
These are the possibles prefixes for outline stuff, they are computed from a property and the current...
bool gpu_ify(const string mod_name)
Transform all the parallel loop nests of a module into smaller independent functions suitable for GPU...
static list loop_nests_to_outline
A simple phase that outlines parallel loops onto GPU.
static bool mark_loop_to_outline(const statement s)
static void gpu_ify_statement(statement s, int depth, const char *mod_name)
Transform a loop nest into a GPU or accelerator-like kernel.
string build_outline_name(const char *base_prefix, const char *mod_name)
Build the outline function name.
bool gpu_loop_nest_annotate_on_statement(statement)
loop_nest_annotate.c
statement get_current_module_statement(void)
Get the current module statement.
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
entity perfectly_nested_loop_index_at_depth(statement s, int depth)
Get the index of the loop at a given depth inside a loop-nest.
statement perfectly_nested_loop_to_body_at_depth(statement s, int depth)
Extract the loop-body of a perfect loop-nest at a given depth.
int depth_of_parallel_perfect_loop_nest(statement s)
Compute the depth of a parallel perfect loop-nest.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define PIPS_PHASE_POSTLUDE(new_module_statement)
End a transformation phase by putting back into PIPS the (possibly) modified statement.
#define PIPS_PHASE_PRELUDE(module_name, debug_env_var)
Start a phase that use a module CODE.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
#define DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
bool statement_loop_p(statement)
void insert_comments_to_statement(statement, const char *)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
#define full_name(dir, name)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define string_undefined_p(s)
void print_statement(statement)
Print a statement on stderr.
void set_bool_property(const char *, bool)
static const char * prefix
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool c_module_p(entity m)
Test if a module "m" is written in C.
string build_new_top_level_module_name(const char *prefix, bool prevent_suffix)
Get a new name for a module built from a prefix.
#define statement_domain
newgen_sizeofexpression_domain_defined
#define statement_number(x)
#define STATEMENT(x)
STATEMENT.
The structure used to build lists in NewGen.
static int depth
la sequence de nids