瀏覽代碼

merge trunk

Andra Hugo 11 年之前
父節點
當前提交
c5ecdeec6a
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 3 3
      src/core/jobs.c
  2. 3 1
      src/datawizard/memalloc.c

+ 3 - 3
src/core/jobs.c

@@ -167,14 +167,14 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 
 #ifdef STARPU_USE_SC_HYPERVISOR
 	size_t data_size = 0;
+	int workerid = starpu_worker_get_id();
 #endif //STARPU_USE_SC_HYPERVISOR
 
 	/* We release handle reference count */
 	if (task->cl)
 	{
-		int i;
+		unsigned i;
 #ifdef STARPU_USE_SC_HYPERVISOR
-		int workerid = starpu_worker_get_id();
 		for(i = 0; i < task->cl->nbuffers; i++)
 		{
 			starpu_data_handle_t handle = STARPU_TASK_GET_HANDLE(task, i);
@@ -183,7 +183,7 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 		}
 #endif //STARPU_USE_SC_HYPERVISOR
 
-		for (i=0; i<task->cl->nbuffers; i++)
+		for (i = 0; i < task->cl->nbuffers; i++)
 		{
 			starpu_data_handle_t handle = STARPU_TASK_GET_HANDLE(task, i);
 			_starpu_spin_lock(&handle->header_lock);

+ 3 - 1
src/datawizard/memalloc.c

@@ -983,8 +983,10 @@ int _starpu_allocate_memory_on_node(starpu_data_handle_t handle, struct _starpu_
 	replicate->allocated = 1;
 	replicate->automatically_allocated = 1;
 
-	if (dst_node == STARPU_MAIN_RAM)
+	if (replicate->relaxed_coherency == 0 && dst_node == STARPU_MAIN_RAM)
 	{
+		/* We are allocating the buffer in main memory, also register it
+		 * for the gcc plugin.  */
 		void *ptr = starpu_data_handle_to_pointer(handle, STARPU_MAIN_RAM);
 		if (ptr != NULL)
 		{