Browse Source

Rewrite `starpu_handle_get_local_ptr' in terms of `starpu_handle_to_pointer'.

Ludovic Courtès 14 years ago
parent
commit
c5900310ca

+ 0 - 2
include/starpu_data_interfaces.h

@@ -95,8 +95,6 @@ struct starpu_data_interface_ops_t {
 	const struct starpu_data_copy_methods *copy_methods;
 	/* Return the current pointer (if any) for the handle on the given node. */
 	void * (*handle_to_pointer)(starpu_data_handle handle, uint32_t node);
-	/* Return the pointer for the handle on the current worker node. */
-	uintptr_t (*get_local_ptr)(starpu_data_handle handle);
 	/* Return an estimation of the size of data, for performance models */
 	size_t (*get_size)(starpu_data_handle handle);
 	/* Return a 32bit footprint which characterizes the data size */

+ 0 - 1
src/datawizard/interfaces/block_interface.c

@@ -81,7 +81,6 @@ static struct starpu_data_interface_ops_t interface_block_ops = {
 	.register_data_handle = register_block_handle,
 	.allocate_data_on_node = allocate_block_buffer_on_node,
 	.handle_to_pointer = block_handle_to_pointer,
-	.get_local_ptr = starpu_block_get_local_ptr,
 	.free_data_on_node = free_block_buffer_on_node,
 	.copy_methods = &block_copy_data_methods_s,
 	.get_size = block_interface_get_size,

+ 2 - 13
src/datawizard/interfaces/data_interface.c

@@ -284,19 +284,8 @@ void *starpu_handle_to_pointer(starpu_data_handle handle, uint32_t node)
 
 void *starpu_handle_get_local_ptr(starpu_data_handle handle)
 {
-	unsigned int local_node;
-
-	local_node = _starpu_get_local_memory_node();
-
-	/* Check whether the operation is supported and the node has actually
-	 * been allocated.  */
-	if (handle->ops->get_local_ptr
-	    && starpu_data_test_if_allocated_on_node(handle, local_node))
-	{
-		return (void*) handle->ops->get_local_ptr(handle);
-	}
-
-	return NULL;
+	return starpu_handle_to_pointer(handle,
+					_starpu_get_local_memory_node());
 }
 
 int starpu_data_get_rank(starpu_data_handle handle)

+ 0 - 1
src/datawizard/interfaces/matrix_interface.c

@@ -80,7 +80,6 @@ struct starpu_data_interface_ops_t _starpu_interface_matrix_ops = {
 	.register_data_handle = register_matrix_handle,
 	.allocate_data_on_node = allocate_matrix_buffer_on_node,
 	.handle_to_pointer = matrix_handle_to_pointer,
-	.get_local_ptr = starpu_matrix_get_local_ptr,
 	.free_data_on_node = free_matrix_buffer_on_node,
 	.copy_methods = &matrix_copy_data_methods_s,
 	.get_size = matrix_interface_get_size,

+ 0 - 1
src/datawizard/interfaces/variable_interface.c

@@ -82,7 +82,6 @@ static struct starpu_data_interface_ops_t interface_variable_ops = {
 	.register_data_handle = register_variable_handle,
 	.allocate_data_on_node = allocate_variable_buffer_on_node,
 	.handle_to_pointer = variable_handle_to_pointer,
-	.get_local_ptr = starpu_variable_get_local_ptr,
 	.free_data_on_node = free_variable_buffer_on_node,
 	.copy_methods = &variable_copy_data_methods_s,
 	.get_size = variable_interface_get_size,

+ 0 - 1
src/datawizard/interfaces/vector_interface.c

@@ -82,7 +82,6 @@ static struct starpu_data_interface_ops_t interface_vector_ops = {
 	.register_data_handle = register_vector_handle,
 	.allocate_data_on_node = allocate_vector_buffer_on_node,
 	.handle_to_pointer = vector_handle_to_pointer,
-	.get_local_ptr = starpu_vector_get_local_ptr,
 	.free_data_on_node = free_vector_buffer_on_node,
 	.copy_methods = &vector_copy_data_methods_s,
 	.get_size = vector_interface_get_size,