Browse Source

Fix supporting more than STARPU_NMAXBUFS handles on mic/scc

Samuel Thibault 10 years ago
parent
commit
82c57f76b7
2 changed files with 4 additions and 1 deletions
  1. 1 1
      src/drivers/mp_common/mp_common.h
  2. 3 0
      src/drivers/mp_common/sink_common.c

+ 1 - 1
src/drivers/mp_common/mp_common.h

@@ -115,7 +115,7 @@ LIST_TYPE(mp_message,
 struct mp_task 
 {
 	void (*kernel)(void **, void *);
-	void * interfaces[STARPU_NMAXBUFS]; 
+	void **interfaces;
 	unsigned nb_interfaces;
 	void *cl_arg;
 	unsigned coreid;

+ 3 - 0
src/drivers/mp_common/sink_common.c

@@ -506,6 +506,7 @@ static void _starpu_sink_common_execute_kernel(struct _starpu_mp_node *node, int
 	unsigned i;
 	for (i = 0; i < task->nb_interfaces; i++)
 		free(task->interfaces[i]);
+	free(task->interfaces);
 	free(task);
 
 }
@@ -589,6 +590,8 @@ void _starpu_sink_common_execute(struct _starpu_mp_node *node,
 	task->nb_interfaces = *(unsigned *) arg_ptr;
 	arg_ptr += sizeof(task->nb_interfaces);
 
+	task->interfaces = malloc(task->nb_interfaces * sizeof(*task->interfaces));
+
 	/* The function needs an array pointing to each interface it needs
 	 * during execution. As in sink-side there is no mean to know which
 	 * kind of interface to expect, the array is composed of unions of