Przeglądaj źródła

add cost model to tasks_size_overhead, to actually benchmarks prediction-enabled heuristics

Samuel Thibault 8 lat temu
rodzic
commit
038d71df3e
1 zmienionych plików z 15 dodań i 1 usunięć
  1. 15 1
      tests/microbenchs/tasks_size_overhead.c

+ 15 - 1
tests/microbenchs/tasks_size_overhead.c

@@ -68,11 +68,25 @@ void func(void *descr[] STARPU_ATTRIBUTE_UNUSED, void *arg)
 	while (usec < n);
 }
 
+double cost_function(struct starpu_task *t, struct starpu_perfmodel_arch *a, unsigned i)
+{
+	(void) t; (void) i;
+	unsigned n = (uintptr_t) t->cl_arg;
+	return n;
+}
+
+static struct starpu_perfmodel perf_model =
+{
+	.type = STARPU_PER_ARCH,
+	.arch_cost_function = cost_function,
+};
+
 static struct starpu_codelet codelet =
 {
 	.cpu_funcs = {func},
 	.nbuffers = 0,
-	.modes = {STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R}
+	.modes = {STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R, STARPU_R},
+	.model = &perf_model,
 };
 
 static void parse_args(int argc, char **argv)