소스 검색

Move starpu_advise_if_data_is_important into user_interactions.c

Cédric Augonnet 15 년 전
부모
커밋
f458a27005
2개의 변경된 파일26개의 추가작업 그리고 21개의 파일을 삭제
  1. 0 21
      src/datawizard/filters.c
  2. 26 0
      src/datawizard/user_interactions.c

+ 0 - 21
src/datawizard/filters.c

@@ -231,27 +231,6 @@ void starpu_unpartition_data(starpu_data_handle root_handle, uint32_t gathering_
 	_starpu_spin_unlock(&root_handle->header_lock);
 }
 
-/* TODO move ! */
-void starpu_advise_if_data_is_important(starpu_data_handle handle, unsigned is_important)
-{
-	_starpu_spin_lock(&handle->header_lock);
-
-	/* first take all the children lock (in order !) */
-	unsigned child;
-	for (child = 0; child < handle->nchildren; child++)
-	{
-		/* make sure the intermediate children is advised as well */
-		if (handle->children[child].nchildren > 0)
-			starpu_advise_if_data_is_important(&handle->children[child], is_important);
-	}
-
-	handle->is_not_important = !is_important;
-
-	/* now the parent may be used again so we release the lock */
-	_starpu_spin_unlock(&handle->header_lock);
-
-}
-
 /* TODO create an alternative version of that function which takes an array of
  * data interface ops in case each child may have its own interface type */
 void starpu_data_create_children(starpu_data_handle handle,

+ 26 - 0
src/datawizard/user_interactions.c

@@ -233,3 +233,29 @@ int starpu_prefetch_data_on_node(starpu_data_handle handle, unsigned node, unsig
 {
 	return _starpu_prefetch_data_on_node_with_mode(handle, node, async, STARPU_R);
 }
+
+/*
+ *	It is possible to specify that a piece of data can be discarded without
+ *	impacting the application.
+ */
+void starpu_advise_if_data_is_important(starpu_data_handle handle, unsigned is_important)
+{
+	_starpu_spin_lock(&handle->header_lock);
+
+	/* first take all the children lock (in order !) */
+	unsigned child;
+	for (child = 0; child < handle->nchildren; child++)
+	{
+		/* make sure the intermediate children is advised as well */
+		if (handle->children[child].nchildren > 0)
+			starpu_advise_if_data_is_important(&handle->children[child], is_important);
+	}
+
+	handle->is_not_important = !is_important;
+
+	/* now the parent may be used again so we release the lock */
+	_starpu_spin_unlock(&handle->header_lock);
+
+}
+
+