From c106ea62a0b482828dd06db4ebe9a62ce0a2c19f Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Wed, 28 Jan 2015 12:57:18 +0000
Subject: [PATCH] add the codelet name information in starpu_codelet for
 eztrace starpu module interceptions

---
 runtime/starpu/include/codelets.h | 83 ++++++++++++++++---------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/runtime/starpu/include/codelets.h b/runtime/starpu/include/codelets.h
index 02b9d2bb3..db5bbb0c3 100644
--- a/runtime/starpu/include/codelets.h
+++ b/runtime/starpu/include/codelets.h
@@ -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)
-- 
GitLab