Kaynağa Gözat

Make sure the chosen source has the buffer initialized and allocated

Samuel Thibault 9 yıl önce
ebeveyn
işleme
8fc1f832c9
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      src/datawizard/coherency.c

+ 6 - 1
src/datawizard/coherency.c

@@ -98,8 +98,12 @@ int _starpu_select_src_node(starpu_data_handle_t handle, unsigned destination)
 		}
 
 	if (cost && src_node != -1)
+	{
 		/* Could estimate through cost, return that */
+		STARPU_ASSERT(handle->per_node[src_node].allocated);
+		STARPU_ASSERT(handle->per_node[src_node].initialized);
 		return src_node;
+	}
 	
 	int i_ram = -1;
 	int i_gpu = -1;
@@ -159,7 +163,8 @@ int _starpu_select_src_node(starpu_data_handle_t handle, unsigned destination)
 		src_node = i_disk;
 
 	STARPU_ASSERT(src_node != -1);
-
+	STARPU_ASSERT(handle->per_node[src_node].allocated);
+	STARPU_ASSERT(handle->per_node[src_node].initialized);
 	return src_node;
 }