Commit c106ea62 authored by PRUVOST Florent's avatar PRUVOST Florent

add the codelet name information in starpu_codelet for eztrace starpu module interceptions

parent f2e853d9
......@@ -37,55 +37,56 @@
#define CODELET_CUDA_FLAGS(flags)
#endif
#define CODELETS_ALL(name, _nbuffers, cpu_func_name, cuda_func_name, _original_location_, cuda_flags) \
struct starpu_perfmodel cl_##name##_fake = { \
.type = STARPU_HISTORY_BASED, \
.symbol = "fake_"#name \
}; \
\
struct starpu_perfmodel cl_##name##_model = { \
.type = STARPU_HISTORY_BASED, \
.symbol = ""#name \
}; \
\
struct starpu_codelet cl_##name = { \
.where = (_original_location_), \
.cpu_func = ((cpu_func_name)), \
CODELET_CUDA_FLAGS(cuda_flags) \
.cuda_func = ((cuda_func_name)), \
.nbuffers = ((_nbuffers)), \
.model = &cl_##name##_model \
}; \
\
void cl_##name##_restrict_where(uint32_t where) \
{ \
if ( cl_##name.where & where ) \
cl_##name.where = (cl_##name.where & where); \
} \
\
void cl_##name##_restore_where(void) \
{ \
cl_##name.where = (_original_location_); \
} \
\
void cl_##name##_restore_model(void) \
{ \
cl_##name.model = &cl_##name##_model; \
#define CODELETS_ALL(cl_name, _nbuffers, cpu_func_name, cuda_func_name, _original_location_, cuda_flags) \
struct starpu_perfmodel cl_##cl_name##_fake = { \
.type = STARPU_HISTORY_BASED, \
.symbol = "fake_"#cl_name \
}; \
\
struct starpu_perfmodel cl_##cl_name##_model = { \
.type = STARPU_HISTORY_BASED, \
.symbol = ""#cl_name \
}; \
\
struct starpu_codelet cl_##cl_name = { \
.where = (_original_location_), \
.cpu_func = ((cpu_func_name)), \
CODELET_CUDA_FLAGS(cuda_flags) \
.cuda_func = ((cuda_func_name)), \
.nbuffers = ((_nbuffers)), \
.model = &cl_##cl_name##_model, \
.name = #cl_name \
}; \
\
void cl_##cl_name##_restrict_where(uint32_t where) \
{ \
if ( cl_##cl_name.where & where ) \
cl_##cl_name.where = (cl_##cl_name.where & where); \
} \
\
void cl_##cl_name##_restore_where(void) \
{ \
cl_##cl_name.where = (_original_location_); \
} \
\
void cl_##cl_name##_restore_model(void) \
{ \
cl_##cl_name.model = &cl_##cl_name##_model; \
}
#define CODELETS_CPU(name, _nbuffers, cpu_func_name) \
#define CODELETS_CPU(name, _nbuffers, cpu_func_name) \
CODELETS_ALL( name, _nbuffers, cpu_func_name, NULL, STARPU_CPU, 0 )
#define CODELETS_GPU(name, _nbuffers, cpu_func_name, cuda_func_name, cuda_flags) \
CODELETS_ALL( name, _nbuffers, cpu_func_name, cuda_func_name, STARPU_CPU | STARPU_CUDA, cuda_flags )
#define CODELETS_ALL_HEADER(name) \
CHAMELEON_CL_CB_HEADER(name) \
void cl_##name##_load_fake_model(void); \
void cl_##name##_restore_model(void); \
extern struct starpu_codelet cl_##name; \
void cl_##name##_restrict_where(uint32_t where); \
#define CODELETS_ALL_HEADER(name) \
CHAMELEON_CL_CB_HEADER(name) \
void cl_##name##_load_fake_model(void); \
void cl_##name##_restore_model(void); \
extern struct starpu_codelet cl_##name; \
void cl_##name##_restrict_where(uint32_t where); \
void cl_##name##_restore_where(void);
#if defined(CHAMELEON_USE_CUDA)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment