Explorar o código

Document the new behavior

Samuel Thibault %!s(int64=9) %!d(string=hai) anos
pai
achega
22543ab4bb

+ 4 - 0
doc/doxygen/chapters/api/codelet_and_tasks.doxy

@@ -450,6 +450,10 @@ should either define this field or the field starpu_task::modes defined above.
 Optional pointer which is passed to the codelet through the second
 Optional pointer which is passed to the codelet through the second
 argument of the codelet implementation (e.g. starpu_codelet::cpu_func
 argument of the codelet implementation (e.g. starpu_codelet::cpu_func
 or starpu_codelet::cuda_func). The default value is <c>NULL</c>.
 or starpu_codelet::cuda_func). The default value is <c>NULL</c>.
+starpu_codelet_pack_args() and starpu_codelet_unpack_args() are helpers that can
+can be used to respectively pack and unpack data into and from it, but the
+application can manage it any way, the only requirement is that the size of the
+data must be set in starpu_task:cl_arg_size .
 
 
 \var size_t starpu_task::cl_arg_size
 \var size_t starpu_task::cl_arg_size
 Optional field. For some specific drivers, the pointer
 Optional field. For some specific drivers, the pointer

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

@@ -131,7 +131,9 @@ starpu_codelet_unpack_args().
 \fn void starpu_codelet_unpack_args(void *cl_arg, ...)
 \fn void starpu_codelet_unpack_args(void *cl_arg, ...)
 \ingroup API_Insert_Task
 \ingroup API_Insert_Task
 Retrieve the arguments of type ::STARPU_VALUE associated to a
 Retrieve the arguments of type ::STARPU_VALUE associated to a
-task automatically created using the function starpu_task_insert().
+task automatically created using the function starpu_task_insert(). If
+some parameter is NULL, unpacking will stop there and ignore the remaining
+parameters.
 
 
 \fn struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...)
 \fn struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...)
 \ingroup API_Insert_Task
 \ingroup API_Insert_Task

+ 2 - 2
src/util/starpu_task_insert.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2010, 2012, 2014-2015  Université de Bordeaux
+ * Copyright (C) 2010, 2012, 2014-2016  Université de Bordeaux
  * Copyright (C) 2011, 2012, 2013, 2014, 2015  CNRS
  * Copyright (C) 2011, 2012, 2013, 2014, 2015  CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * StarPU is free software; you can redistribute it and/or modify
@@ -50,7 +50,7 @@ void starpu_codelet_unpack_args(void *_cl_arg, ...)
 	{
 	{
 		void *argptr = va_arg(varg_list, void *);
 		void *argptr = va_arg(varg_list, void *);
 
 
-		// If not reading all cl_args
+		/* If not reading all cl_args */
 		if(argptr == NULL)
 		if(argptr == NULL)
 			break;
 			break;