Pārlūkot izejas kodu

There is no need to have starpu_data_state_create public. We also move it in a
better place and rename it into _starpu_data_handle_allocate.

Cédric Augonnet 15 gadi atpakaļ
vecāks
revīzija
902eaaab9c

+ 0 - 1
include/starpu_data.h

@@ -41,7 +41,6 @@ typedef struct starpu_buffer_descr_t {
 } starpu_buffer_descr;
 
 struct starpu_data_interface_ops_t;
-starpu_data_handle starpu_data_state_create(struct starpu_data_interface_ops_t *interface_ops);
 
 void starpu_unpartition_data(starpu_data_handle root_data, uint32_t gathering_node);
 void starpu_delete_data(starpu_data_handle state);

+ 1 - 22
src/datawizard/hierarchy.c

@@ -14,7 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "hierarchy.h"
+#include <datawizard/hierarchy.h>
 
 /* 
  * Stop monitoring a data
@@ -336,27 +336,6 @@ void starpu_advise_if_data_is_important(starpu_data_handle handle, unsigned is_i
 
 }
 
-starpu_data_handle starpu_data_state_create(struct starpu_data_interface_ops_t *interface_ops)
-{
-	starpu_data_handle handle =
-		calloc(1, sizeof(struct starpu_data_state_t));
-
-	STARPU_ASSERT(handle);
-
-	handle->ops = interface_ops;
-
-	size_t interfacesize = interface_ops->interface_size;
-
-	unsigned node;
-	for (node = 0; node < STARPU_MAXNODES; node++)
-	{
-		handle->interface[node] = calloc(1, interfacesize);
-		STARPU_ASSERT(handle->interface[node]);
-	}
-
-	return handle;
-}
-
 /* 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,

+ 22 - 1
src/datawizard/interfaces/data_interface.c

@@ -26,12 +26,33 @@ void *starpu_data_get_interface_on_node(starpu_data_handle handle, unsigned memo
 	return handle->interface[memory_node];
 }
 
+static starpu_data_handle _starpu_data_handle_allocate(struct starpu_data_interface_ops_t *interface_ops)
+{
+	starpu_data_handle handle =
+		calloc(1, sizeof(struct starpu_data_state_t));
+
+	STARPU_ASSERT(handle);
+
+	handle->ops = interface_ops;
+
+	size_t interfacesize = interface_ops->interface_size;
+
+	unsigned node;
+	for (node = 0; node < STARPU_MAXNODES; node++)
+	{
+		handle->interface[node] = calloc(1, interfacesize);
+		STARPU_ASSERT(handle->interface[node]);
+	}
+
+	return handle;
+}
+
 void _starpu_register_data_handle(starpu_data_handle *handleptr, uint32_t home_node,
 				void *interface,
 				struct starpu_data_interface_ops_t *ops)
 {
 	starpu_data_handle handle =
-		starpu_data_state_create(ops);
+		_starpu_data_handle_allocate(ops);
 
 	STARPU_ASSERT(handleptr);
 	*handleptr = handle;