PIPS
|
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "effects-util.h"
#include "misc.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "control.h"
#include "callgraph.h"
#include "pipsdbm.h"
#include "resources.h"
Go to the source code of this file.
Functions | |
static bool | mark_loop_to_outline (const statement s) |
static void | gpu_memory_apply (statement s, int depth) |
bool | gpu_memory (const char *module_name) |
Variables | |
list | loop_nests_to_outline |
A simple phase that allocate memory on an accelerator and add memory transfer around a kernel. More... | |
bool gpu_memory | ( | const char * | module_name | ) |
Definition at line 76 of file gpu_memory.c.
References call_domain, compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, gen_identity(), gen_recurse, get_current_module_statement(), gpu_memory_apply(), module_name(), module_statement, PIPS_PHASE_POSTLUDE, PIPS_PHASE_PRELUDE, reset_cumulated_rw_effects(), and set_cumulated_rw_effects().
First outline the innermost code (the kernel itself) to avoid spoiling its memory effects if we start with the outermost code first:
Definition at line 57 of file gpu_memory.c.
References build_new_top_level_module_name(), CONS, depth, ifdebug, NIL, outliner(), perfectly_nested_loop_to_body_at_depth(), pips_debug, print_statement(), and STATEMENT.
Referenced by gpu_memory().
An interesting loop must be parallel first...
We recurse on statements instead of loops in order to pick informations on the statement itself, such as pragmas
Since we only outline outermost loop-nest, stop digging further in this statement:
Definition at line 31 of file gpu_memory.c.
References CONS, depth_of_parallel_perfect_loop_nest(), ifdebug, loop_nests_to_outline, pips_debug, print_statement(), STATEMENT, and statement_number.
list loop_nests_to_outline |
A simple phase that allocate memory on an accelerator and add memory transfer around a kernel.
Ronan Store the loop nests found that meet the spec to be executed on a GPU. Use a list and not a set or hash_map to have always the same order .Ker yell@ hpc- proje ct.c om
Definition at line 27 of file gpu_memory.c.
Referenced by mark_loop_to_outline().