Преглед на файлове

Add missing calls to starpu_profiling_init

Samuel Thibault преди 14 години
родител
ревизия
d6bdc92843
променени са 3 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 3 1
      examples/lu/lu_example.c
  2. 1 0
      examples/profiling/profiling.c
  3. 3 0
      include/starpu_profiling.h

+ 3 - 1
examples/lu/lu_example.c

@@ -280,8 +280,10 @@ int main(int argc, char **argv)
 	if (bound)
 		starpu_bound_start(bounddeps, boundprio);
 
-	if (profile)
+	if (profile) {
+		starpu_profiling_init();
 		starpu_profiling_status_set(STARPU_PROFILING_ENABLE);
+	}
 
 	/* Factorize the matrix (in place) */
 	if (pivot)

+ 1 - 0
examples/profiling/profiling.c

@@ -34,6 +34,7 @@ int main(int argc, char **argv)
 	starpu_init(NULL);
 
 	/* Enable profiling */
+	starpu_profiling_init();
 	starpu_profiling_status_set(STARPU_PROFILING_ENABLE);
 
 	/* We should observe at least 500ms in the sleep time reported by every

+ 3 - 0
include/starpu_profiling.h

@@ -75,6 +75,9 @@ struct starpu_bus_profiling_info {
 	int transfer_count;
 };
 
+/* This function needs to be called before other starpu_profile_* functions */
+int starpu_profiling_init(void);
+
 /* This function sets the profiling status:
  * - enable with STARPU_PROFILING_ENABLE
  * - disable with STARPU_PROFILING_DISABLE