26 #include "pips_config.h"
37 #include "resources.h"
50 #define XMLPRETTY ".xml"
62 #define xml_print(format, args...) \
64 pips_assert("Output is set",out_fp); \
65 fprintf(out_fp,format,##args); \
172 size_t sentinel_len = strlen(
"// To be assigned to a call to P4A_vp_X: ");
174 while((sentinel=strstr(
comment,
"// To be assigned to a call to P4A_vp_"))!=NULL) {
175 string varname_ptr = sentinel+sentinel_len;
176 string varname_end = strchr(varname_ptr,
'\n');
177 int varname_len = varname_end-varname_ptr;
178 string varname =
strndup(varname_ptr,varname_len);
180 *dims =
CONS(
string,varname,*dims);
199 debug_on(
"GPU_XML_DUMP_DEBUG_LEVEL");
226 string original_name = mod_name + strlen(
"p4a_wrapper_");
229 xml_print(
"<Task name=\"%s\" kernel=\"%s\" nbParallelLoops=\"%zu\">" NL,
234 for(
int i = 1; i <= nparams; i++) {
236 bool is_a_dim =
false;
bool statement_consistent_p(statement p)
static statement module_statement
struct _newgen_struct_statement_ * statement
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
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_FILE_RESOURCE
Put a file resource into the current workspace database.
string db_build_file_resource_name(const char *rname, const char *oname, const char *suffix)
returns an allocated file name for a file resource.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
#define string_undefined_p(s)
string db_get_current_workspace_directory(void)
string string_of_type(const type)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity find_ith_parameter(entity, int)
#define type_functional_p(x)
#define type_functional(x)
#define basic_pointer_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define functional_parameters(x)
#define statement_comments(x)
#define variable_basic(x)
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
The structure used to build lists in NewGen.
void xml_print_entity_full(entity e)
xml_output.c
static void xml_print_parameter(entity p, bool is_a_dim)
bool gpu_xml_dump(string mod_name)
PIPSMAKE INTERFACE.
#define xml_print(format, args...)
static void xml_print_type(type t)
void gather_grid_dim(statement s, void *ctx)
static void xml_output(string s)
static void xml_set_output(FILE *new_fp)
static void xml_print_entity_name(entity e)