Explorar o código

examples/basic_examples/hello_world.c: use starpu_codelet_init to initialise codelet

Nathalie Furmento %!s(int64=12) %!d(string=hai) anos
pai
achega
792e54ef83
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      examples/basic_examples/hello_world.c

+ 2 - 2
examples/basic_examples/hello_world.c

@@ -59,10 +59,9 @@ void cpu_func(void *buffers[], void *cl_arg)
 	FPRINTF(stdout, "Hello world (params = {%i, %f} )\n", params->i, params->f);
 }
 
-struct starpu_codelet cl = {};
-
 int main(int argc, char **argv)
 {
+	struct starpu_codelet cl;
 	struct starpu_task *task;
 	struct params params = {1, 2.0f};
 	int ret;
@@ -80,6 +79,7 @@ int main(int argc, char **argv)
 	 * called */
 	task = starpu_task_create();
 
+	starpu_codelet_init(&cl);
 	/* this codelet may only be executed on a CPU, and its cpu
  	 * implementation is function "cpu_func" */
 	cl.cpu_funcs[0] = cpu_func;