Pārlūkot izejas kodu

starpu_task_build: Update to set starpu_task::cl_arg_free to 1 if some arguments of type STARPU_VALUE are given

Nathalie Furmento 9 gadi atpakaļ
vecāks
revīzija
2c7ab14ee2

+ 2 - 0
ChangeLog

@@ -173,6 +173,8 @@ Changes:
 Small changes:
   * Rename function starpu_trace_user_event() as
     starpu_fxt_trace_user_event()
+  * Update starpu_task_build() to set starpu_task::cl_arg_free to 1 if
+    some arguments of type ::STARPU_VALUE are given.
 
 StarPU 1.1.5 (svn revision xxx)
 ==============================================

+ 3 - 1
doc/doxygen/chapters/api/insert_task.doxy

@@ -1,7 +1,7 @@
 /*
  * This file is part of the StarPU Handbook.
  * Copyright (C) 2009--2011  Universit@'e de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
  * Copyright (C) 2011, 2012 INRIA
  * See the file version.doxy for copying conditions.
  */
@@ -139,5 +139,7 @@ Create a task corresponding to \p cl with the following arguments.
 The argument list must be zero-terminated. The arguments
 following the codelet are the same as the ones for the function
 starpu_task_insert().
+If some arguments of type ::STARPU_VALUE are given, the parameter
+starpu_task::cl_arg_free will be set to 1.
 
 */

+ 0 - 1
examples/sched_ctx/parallel_tasks_reuse_handle.c

@@ -202,7 +202,6 @@ int main(int argc, char **argv)
 				    STARPU_VALUE,&size,sizeof(int),
 				    STARPU_SCHED_CTX, main_context.id,
 				    0);
-		t->cl_arg_free = 1;
 		t->destroy = 1;
 		t->possibly_parallel = 1;
 

+ 5 - 1
src/util/starpu_task_insert.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012, 2014-2015  Université de Bordeaux
- * Copyright (C) 2011, 2012, 2013, 2014  CNRS
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -129,6 +129,10 @@ struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...)
 
 	va_start(varg_list, cl);
 	task = _starpu_task_build_v(cl, "task_build", 0, varg_list);
+	if (task->cl_arg)
+	{
+		task->cl_arg_free = 1;
+}
 	va_end(varg_list);
 
 	return task;

+ 1 - 2
tests/main/insert_task.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  CNRS
+ * Copyright (C) 2011, 2012, 2013, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -100,7 +100,6 @@ int test_codelet(struct starpu_codelet *codelet, int task_insert, int args, int
 			task = starpu_task_build(codelet,
 						 STARPU_RW, data_handles[0], STARPU_RW, data_handles[1],
 						 0);
-		task->cl_arg_free = 1;
 		ret = starpu_task_submit(task);
 		if (ret == -ENODEV) goto enodev;
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");