Browse Source

expose starpu_allocate_buffer_on_node and starpu_free_buffer_on_node to application, so application-defined interfaces can use them too

Samuel Thibault 12 years ago
parent
commit
ab7c89dbe8

+ 16 - 0
doc/chapters/basic-api.texi

@@ -592,6 +592,7 @@ available on the given memory node instead of main memory.
 @menu
 * Registering Data::
 * Accessing Data Interfaces::
+* Defining Interface::
 @end menu
 
 @node Registering Data
@@ -1189,6 +1190,21 @@ Return the size of the elements registered into the matrix designated by
 @var{interface}.
 @end defmac
 
+@node Defining Interface
+@subsection Defining Interface
+
+Applications can provide their own interface. An example is provided in
+@code{examples/interface}. A few helpers are provided.
+
+@deftypefun uintptr_t starpu_allocate_buffer_on_node (uint32_t @var{dst_node}, size_t @var{size})
+Allocate @var{size} bytes on node @var{dst_node}. This returns 0 if allocation
+failed, the allocation method should then return -ENOMEM as allocated size.
+@end deftypefun
+
+@deftypefun void starpu_free_buffer_on_node (uint32_t @var{dst_node}, uintptr_t @var{data})
+Free @var{data} on node @var{dst_node}.
+@end deftypefun
+
 @node Data Partition
 @section Data Partition
 

+ 36 - 105
examples/filters/custom_mf/custom_interface.c

@@ -157,74 +157,42 @@ static ssize_t allocate_custom_buffer_on_node(void *data_interface, uint32_t nod
 	struct custom_data_interface *custom_interface;
 	custom_interface = (struct custom_data_interface *) data_interface;
 
-	switch(starpu_node_get_kind(node))
-	{
-	case STARPU_CPU_RAM:
-		size = custom_interface->nx * custom_interface->ops->cpu_elemsize;
-		custom_interface->cpu_ptr = (void*) malloc(size);
-		if (!custom_interface->cpu_ptr)
-			return -ENOMEM;
-#ifdef STARPU_USE_CUDA
-		custom_interface->cuda_ptr = (void *) malloc(size);
-		if (!custom_interface->cuda_ptr)
-		{
-			free(custom_interface->cpu_ptr);
-			custom_interface->cpu_ptr = NULL;
-			return -ENOMEM;
-		}
-#endif /* !STARPU_USE_CUDA */
-#ifdef STARPU_USE_OPENCL
-		custom_interface->opencl_ptr = malloc(size);
-		if (custom_interface->cuda_ptr == NULL)
-		{
-			free(custom_interface->cpu_ptr);
+	size = custom_interface->nx * custom_interface->ops->cpu_elemsize;
+	custom_interface->cpu_ptr = (void*) starpu_allocate_buffer_on_node(node, size);
+	if (!custom_interface->cpu_ptr)
+		goto fail_cpu;
 #ifdef STARPU_USE_CUDA
-			free(custom_interface->cuda_ptr);
-#endif /* !STARPU_USE_CUDA */
-			return -ENOMEM;
-		}
-#endif /* !STARPU_USE_OPENCL */
-			
-		break;
-#ifdef STARPU_USE_CUDA
-	case STARPU_CUDA_RAM:
-	{
-		cudaError_t err;
-		size = custom_interface->nx * custom_interface->ops->cpu_elemsize;
-		err = cudaMalloc(&custom_interface->cuda_ptr, size);
-		if (err != cudaSuccess)
-			return -ENOMEM;
-
-		err = cudaMalloc(&custom_interface->cpu_ptr, size);
-		if (err != cudaSuccess)
-		{
-			cudaFree(custom_interface->cuda_ptr);
-			return -ENOMEM;
-		}
-		break;
-	}
+	custom_interface->cuda_ptr = (void*) starpu_allocate_buffer_on_node(node, size);
+	if (!custom_interface->cuda_ptr)
+		goto fail_cuda;
 #endif
 #ifdef STARPU_USE_OPENCL
-	case STARPU_OPENCL_RAM:
-	{
-		cl_int err;
-		cl_mem memory;
-		ssize_t size = custom_interface->nx * custom_interface->ops->cpu_elemsize;
-		err = starpu_opencl_allocate_memory(&memory, size, CL_MEM_READ_WRITE);
-		if (err != CL_SUCCESS)
-			STARPU_OPENCL_REPORT_ERROR(err);
-
-		custom_interface->opencl_ptr = memory;
-
-		break;
-	}
-#endif /* !STARPU_USE_OPENCL */
-	default:
-		assert(0);
-	}
+	custom_interface->opencl_ptr = (void*) starpu_allocate_buffer_on_node(node, size);
+	if (!custom_interface->opencl_ptr)
+		goto fail_opencl;
+#endif
 
 	/* XXX We may want to return cpu_size + cuda_size + ... */
-	return size;
+	return size
+#ifdef STARPU_USE_CUDA
+		+size
+#endif
+#ifdef STARPU_USE_OPENCL
+		+size
+#endif
+		;
+#ifdef STARPU_USE_OPENCL
+fail_opencl:
+#ifdef STARPU_USE_CUDA
+	starpu_free_buffer_on_node(node, (uintptr_t) custom_interface->cuda_ptr);
+#endif
+#endif
+#ifdef STARPU_USE_CUDA
+fail_cuda:
+#endif
+	starpu_free_buffer_on_node(node, (uintptr_t) custom_interface->cpu_ptr);
+fail_cpu:
+	return -ENOMEM;
 }
 
 static void free_custom_buffer_on_node(void *data_interface, uint32_t node)
@@ -232,50 +200,13 @@ static void free_custom_buffer_on_node(void *data_interface, uint32_t node)
 	struct custom_data_interface *custom_interface;
 	custom_interface = (struct custom_data_interface *) data_interface;
 
-	switch(starpu_node_get_kind(node))
-	{
-	case STARPU_CPU_RAM:
-		if (custom_interface->cpu_ptr != NULL)
-		{
-			free(custom_interface->cpu_ptr);
-			custom_interface->cpu_ptr = NULL;
-		}
+	starpu_free_buffer_on_node(node, (uintptr_t) custom_interface->cpu_ptr);
 #ifdef STARPU_USE_CUDA
-		if (custom_interface->cuda_ptr != NULL)
-		{
-			free(custom_interface->cuda_ptr);
-			custom_interface->cuda_ptr = NULL;
-		}
-#endif /* !STARPU_USE_CUDA */
+	starpu_free_buffer_on_node(node, (uintptr_t) custom_interface->cuda_ptr);
+#endif
 #ifdef STARPU_USE_OPENCL
-		if (custom_interface->opencl_ptr != NULL)
-		{
-			free(custom_interface->opencl_ptr);
-			custom_interface->opencl_ptr = NULL;
-		}
-#endif /* !STARPU_USE_OPENCL */
-		break;
-#ifdef STARPU_USE_CUDA
-	case STARPU_CUDA_RAM:
-		if (custom_interface->cpu_ptr != NULL)
-		{
-			cudaError_t err;
-			err = cudaFree(custom_interface->cpu_ptr);
-			if (err != cudaSuccess)
-				fprintf(stderr, "cudaFree failed...\n");
-		}
-		if (custom_interface->cuda_ptr != NULL)
-		{
-			cudaError_t err;
-			err = cudaFree(custom_interface->cuda_ptr);
-			if (err != cudaSuccess)
-				fprintf(stderr, "cudaFree failed...\n");
-		}
-		break;
-#endif /* !STARPU_USE_CUDA */
-	default:
-		assert(0);
-	}
+	starpu_free_buffer_on_node(node, (uintptr_t) custom_interface->opencl_ptr);
+#endif
 }
 
 static void*

+ 14 - 77
examples/interface/complex_interface.c

@@ -62,97 +62,34 @@ static starpu_ssize_t complex_allocate_data_on_node(void *data_interface, uint32
 {
 	struct starpu_complex_interface *complex_interface = (struct starpu_complex_interface *) data_interface;
 
-	unsigned fail = 0;
 	double *addr_real = 0;
 	double *addr_imaginary = 0;
 	ssize_t requested_memory = complex_interface->nx * sizeof(complex_interface->real[0]);
 
-	enum starpu_node_kind kind = starpu_node_get_kind(node);
-
-	switch(kind)
-	{
-		case STARPU_CPU_RAM:
-			addr_real = malloc(requested_memory);
-			addr_imaginary = malloc(requested_memory);
-			if (!addr_real || !addr_imaginary)
-				fail = 1;
-			break;
-#ifdef STARPU_USE_CUDA
-		case STARPU_CUDA_RAM:
-		{
-			cudaError_t status;
-			status = cudaMalloc((void **)&addr_real, requested_memory);
-			if (!addr_real || (status != cudaSuccess))
-			{
-				if (STARPU_UNLIKELY(status != cudaErrorMemoryAllocation))
-					STARPU_CUDA_REPORT_ERROR(status);
-
-				fail = 1;
-			}
-			else
-			{
-				status = cudaMalloc((void **)&addr_imaginary, requested_memory);
-				if (!addr_imaginary || (status != cudaSuccess))
-				{
-					if (STARPU_UNLIKELY(status != cudaErrorMemoryAllocation))
-						STARPU_CUDA_REPORT_ERROR(status);
-
-					fail = 1;
-				}
-			}
-
-			break;
-		}
-#endif
-#ifdef STARPU_USE_OPENCL
-	        case STARPU_OPENCL_RAM:
-		{
-			int ret;
-			cl_mem real, imaginary;
-			ret = starpu_opencl_allocate_memory(&real, requested_memory, CL_MEM_READ_WRITE);
-			if (ret != CL_SUCCESS)
-			{
-				fail = 1;
-				break;
-			}
-			else
-			{
-				addr_real = (double *) real;
-			}
-
-			ret = starpu_opencl_allocate_memory(&imaginary, requested_memory, CL_MEM_READ_WRITE);
-			if (ret != CL_SUCCESS)
-			{
-				fail = 1;
-				break;
-			}
-			else
-			{
-				addr_imaginary = (double *) imaginary;
-			}
-			break;
-		}
-#endif
-		default:
-			STARPU_ABORT();
-	}
-
-	if (fail)
-		return -ENOMEM;
+	addr_real = (double*) starpu_allocate_buffer_on_node(node, requested_memory);
+	if (!addr_real)
+		goto fail_real;
+	addr_imaginary = (double*) starpu_allocate_buffer_on_node(node, requested_memory);
+	if (!addr_imaginary)
+		goto fail_imaginary;
 
 	/* update the data properly in consequence */
 	complex_interface->real = addr_real;
 	complex_interface->imaginary = addr_imaginary;
 
 	return 2*requested_memory;
+
+fail_imaginary:
+	starpu_free_buffer_on_node(node, (uintptr_t) addr_real);
+fail_real:
+	return -ENOMEM;
 }
 
 static void complex_free_data_on_node(void *data_interface, uint32_t node)
 {
-	//struct starpu_complex_interface *complex_interface = (struct starpu_complex_interface *) data_interface;
-#ifdef STARPU_DEVEL
-#warning TODO: to be written
-#endif
+	struct starpu_complex_interface *complex_interface = (struct starpu_complex_interface *) data_interface;
+	starpu_free_buffer_on_node(node, (uintptr_t) complex_interface->real);
+	starpu_free_buffer_on_node(node, (uintptr_t) complex_interface->imaginary);
 }
 
 static size_t complex_get_size(starpu_data_handle_t handle)

+ 5 - 0
include/starpu_data_interfaces.h

@@ -144,6 +144,11 @@ int starpu_data_interface_get_next_id(void);
 void starpu_data_register(starpu_data_handle_t *handleptr, uint32_t home_node, void *data_interface, struct starpu_data_interface_ops *ops);
 void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc);
 
+/* Allocate SIZE bytes on node NODE */
+uintptr_t starpu_allocate_buffer_on_node(uint32_t dst_node, size_t size);
+/* Free ADDR on node NODE */
+void starpu_free_buffer_on_node(uint32_t dst_node, uintptr_t addr);
+
 /* Return the pointer associated with HANDLE on node NODE or NULL if HANDLE's
  * interface does not support this operation or data for this handle is not
  * allocated on that node. */

+ 8 - 8
src/datawizard/interfaces/bcsr_interface.c

@@ -274,13 +274,13 @@ static ssize_t allocate_bcsr_buffer_on_node(void *data_interface_, uint32_t dst_
 	uint32_t r = bcsr_interface->r;
 	uint32_t c = bcsr_interface->c;
 
-	addr_nzval = _starpu_allocate_buffer_on_node(dst_node, nnz*r*c*elemsize);
+	addr_nzval = starpu_allocate_buffer_on_node(dst_node, nnz*r*c*elemsize);
 	if (!addr_nzval)
 		goto fail_nzval;
-	addr_colind = _starpu_allocate_buffer_on_node(dst_node, nnz*sizeof(uint32_t));
+	addr_colind = starpu_allocate_buffer_on_node(dst_node, nnz*sizeof(uint32_t));
 	if (!addr_colind)
 		goto fail_colind;
-	addr_rowptr = _starpu_allocate_buffer_on_node(dst_node, (nrow+1)*sizeof(uint32_t));
+	addr_rowptr = starpu_allocate_buffer_on_node(dst_node, (nrow+1)*sizeof(uint32_t));
 	if (!addr_rowptr)
 		goto fail_rowptr;
 
@@ -296,9 +296,9 @@ static ssize_t allocate_bcsr_buffer_on_node(void *data_interface_, uint32_t dst_
 	return allocated_memory;
 
 fail_rowptr:
-	_starpu_free_buffer_on_node(dst_node, addr_colind);
+	starpu_free_buffer_on_node(dst_node, addr_colind);
 fail_colind:
-	_starpu_free_buffer_on_node(dst_node, addr_nzval);
+	starpu_free_buffer_on_node(dst_node, addr_nzval);
 fail_nzval:
 	/* allocation failed */
 	return -ENOMEM;
@@ -308,9 +308,9 @@ static void free_bcsr_buffer_on_node(void *data_interface, uint32_t node)
 {
 	struct starpu_bcsr_interface *bcsr_interface = (struct starpu_bcsr_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, bcsr_interface->nzval);
-	_starpu_free_buffer_on_node(node, (uintptr_t) bcsr_interface->colind);
-	_starpu_free_buffer_on_node(node, (uintptr_t) bcsr_interface->rowptr);
+	starpu_free_buffer_on_node(node, bcsr_interface->nzval);
+	starpu_free_buffer_on_node(node, (uintptr_t) bcsr_interface->colind);
+	starpu_free_buffer_on_node(node, (uintptr_t) bcsr_interface->rowptr);
 }
 
 #ifdef STARPU_USE_CUDA

+ 2 - 2
src/datawizard/interfaces/block_interface.c

@@ -304,7 +304,7 @@ static ssize_t allocate_block_buffer_on_node(void *data_interface_, uint32_t dst
 
 	ssize_t allocated_memory;
 
-	handle = _starpu_allocate_buffer_on_node(dst_node, nx*ny*nz*elemsize);
+	handle = starpu_allocate_buffer_on_node(dst_node, nx*ny*nz*elemsize);
 
 	if (!handle)
 		return -ENOMEM;
@@ -328,7 +328,7 @@ static void free_block_buffer_on_node(void *data_interface, uint32_t node)
 {
 	struct starpu_block_interface *block_interface = (struct starpu_block_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, block_interface->ptr);
+	starpu_free_buffer_on_node(node, block_interface->ptr);
 }
 
 #ifdef STARPU_USE_CUDA

+ 8 - 8
src/datawizard/interfaces/coo_interface.c

@@ -363,13 +363,13 @@ allocate_coo_buffer_on_node(void *data_interface, uint32_t dst_node)
 	uint32_t n_values = coo_interface->n_values;
 	size_t elemsize = coo_interface->elemsize;
 
-	addr_columns = (void*) _starpu_allocate_buffer_on_node(dst_node, n_values * sizeof(coo_interface->columns[0]));
+	addr_columns = (void*) starpu_allocate_buffer_on_node(dst_node, n_values * sizeof(coo_interface->columns[0]));
 	if (STARPU_UNLIKELY(addr_columns == NULL))
 		goto fail_columns;
-	addr_rows = (void*) _starpu_allocate_buffer_on_node(dst_node, n_values * sizeof(coo_interface->rows[0]));
+	addr_rows = (void*) starpu_allocate_buffer_on_node(dst_node, n_values * sizeof(coo_interface->rows[0]));
 	if (STARPU_UNLIKELY(addr_rows == NULL))
 		goto fail_rows;
-	addr_values = _starpu_allocate_buffer_on_node(dst_node, n_values * elemsize);
+	addr_values = starpu_allocate_buffer_on_node(dst_node, n_values * elemsize);
 	if (STARPU_UNLIKELY(addr_values == (uintptr_t) NULL))
 		goto fail_values;
 
@@ -380,9 +380,9 @@ allocate_coo_buffer_on_node(void *data_interface, uint32_t dst_node)
 	return n_values * (sizeof(coo_interface->columns[0]) + sizeof(coo_interface->rows[0]) + elemsize);
 
 fail_values:
-	_starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_rows);
+	starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_rows);
 fail_rows:
-	_starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_columns);
+	starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_columns);
 fail_columns:
 	return -ENOMEM;
 }
@@ -393,9 +393,9 @@ free_coo_buffer_on_node(void *data_interface, uint32_t node)
 	struct starpu_coo_interface *coo_interface =
 		(struct starpu_coo_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, (uintptr_t) coo_interface->columns);
-	_starpu_free_buffer_on_node(node, (uintptr_t) coo_interface->rows);
-	_starpu_free_buffer_on_node(node, coo_interface->values);
+	starpu_free_buffer_on_node(node, (uintptr_t) coo_interface->columns);
+	starpu_free_buffer_on_node(node, (uintptr_t) coo_interface->rows);
+	starpu_free_buffer_on_node(node, coo_interface->values);
 }
 
 static size_t

+ 8 - 8
src/datawizard/interfaces/csr_interface.c

@@ -249,13 +249,13 @@ static ssize_t allocate_csr_buffer_on_node(void *data_interface_, uint32_t dst_n
 	uint32_t nrow = csr_interface->nrow;
 	size_t elemsize = csr_interface->elemsize;
 
-	addr_nzval = _starpu_allocate_buffer_on_node(dst_node, nnz*elemsize);
+	addr_nzval = starpu_allocate_buffer_on_node(dst_node, nnz*elemsize);
 	if (!addr_nzval)
 		goto fail_nzval;
-	addr_colind = (uint32_t*) _starpu_allocate_buffer_on_node(dst_node, nnz*sizeof(uint32_t));
+	addr_colind = (uint32_t*) starpu_allocate_buffer_on_node(dst_node, nnz*sizeof(uint32_t));
 	if (!addr_colind)
 		goto fail_colind;
-	addr_rowptr = (uint32_t*) _starpu_allocate_buffer_on_node(dst_node, (nrow+1)*sizeof(uint32_t));
+	addr_rowptr = (uint32_t*) starpu_allocate_buffer_on_node(dst_node, (nrow+1)*sizeof(uint32_t));
 	if (!addr_rowptr)
 		goto fail_rowptr;
 
@@ -271,9 +271,9 @@ static ssize_t allocate_csr_buffer_on_node(void *data_interface_, uint32_t dst_n
 	return allocated_memory;
 
 fail_rowptr:
-	_starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_colind);
+	starpu_free_buffer_on_node(dst_node, (uintptr_t) addr_colind);
 fail_colind:
-	_starpu_free_buffer_on_node(dst_node, addr_nzval);
+	starpu_free_buffer_on_node(dst_node, addr_nzval);
 fail_nzval:
 	/* allocation failed */
 	return -ENOMEM;
@@ -283,9 +283,9 @@ static void free_csr_buffer_on_node(void *data_interface, uint32_t node)
 {
 	struct starpu_csr_interface *csr_interface = (struct starpu_csr_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, csr_interface->nzval);
-	_starpu_free_buffer_on_node(node, (uintptr_t) csr_interface->colind);
-	_starpu_free_buffer_on_node(node, (uintptr_t) csr_interface->rowptr);
+	starpu_free_buffer_on_node(node, csr_interface->nzval);
+	starpu_free_buffer_on_node(node, (uintptr_t) csr_interface->colind);
+	starpu_free_buffer_on_node(node, (uintptr_t) csr_interface->rowptr);
 }
 
 #ifdef STARPU_USE_CUDA

+ 2 - 2
src/datawizard/interfaces/matrix_interface.c

@@ -283,7 +283,7 @@ static ssize_t allocate_matrix_buffer_on_node(void *data_interface_, uint32_t ds
 
 	ssize_t allocated_memory;
 
-	handle = _starpu_allocate_buffer_on_node(dst_node, nx*ny*elemsize);
+	handle = starpu_allocate_buffer_on_node(dst_node, nx*ny*elemsize);
 
 	if (!handle)
 		return -ENOMEM;
@@ -306,7 +306,7 @@ static void free_matrix_buffer_on_node(void *data_interface, uint32_t node)
 {
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, matrix_interface->ptr);
+	starpu_free_buffer_on_node(node, matrix_interface->ptr);
 }
 
 #ifdef STARPU_USE_CUDA

+ 8 - 8
src/datawizard/interfaces/multiformat_interface.c

@@ -249,14 +249,14 @@ static ssize_t allocate_multiformat_buffer_on_node(void *data_interface_, uint32
 
 	size = multiformat_interface->nx * multiformat_interface->ops->cpu_elemsize;
 	allocated_memory += size;
-	addr = _starpu_allocate_buffer_on_node(dst_node, size);
+	addr = starpu_allocate_buffer_on_node(dst_node, size);
 	if (!addr)
 		goto fail_cpu;
 	multiformat_interface->cpu_ptr = (void *) addr;
 #ifdef STARPU_USE_CUDA
 	size = multiformat_interface->nx * multiformat_interface->ops->cuda_elemsize;
 	allocated_memory += size;
-	addr = _starpu_allocate_buffer_on_node(dst_node, size);
+	addr = starpu_allocate_buffer_on_node(dst_node, size);
 	if (!addr)
 		goto fail_cuda;
 	multiformat_interface->cuda_ptr = (void *) addr;
@@ -264,7 +264,7 @@ static ssize_t allocate_multiformat_buffer_on_node(void *data_interface_, uint32
 #ifdef STARPU_USE_OPENCL
 	size = multiformat_interface->nx * multiformat_interface->ops->opencl_elemsize;
 	allocated_memory += size;
-	addr = _starpu_allocate_buffer_on_node(dst_node, size);
+	addr = starpu_allocate_buffer_on_node(dst_node, size);
 	if (!addr)
 		goto fail_opencl;
 	multiformat_interface->opencl_ptr = (void *) addr;
@@ -275,13 +275,13 @@ static ssize_t allocate_multiformat_buffer_on_node(void *data_interface_, uint32
 #ifdef STARPU_USE_OPENCL
 fail_opencl:
 #ifdef STARPU_USE_CUDA
-	_starpu_free_buffer_on_node(dst_node, (uintptr_t) multiformat_interface->cuda_ptr);
+	starpu_free_buffer_on_node(dst_node, (uintptr_t) multiformat_interface->cuda_ptr);
 #endif
 #endif
 #ifdef STARPU_USE_CUDA
 fail_cuda:
 #endif
-	_starpu_free_buffer_on_node(dst_node, (uintptr_t) multiformat_interface->cpu_ptr);
+	starpu_free_buffer_on_node(dst_node, (uintptr_t) multiformat_interface->cpu_ptr);
 fail_cpu:
 	return -ENOMEM;
 }
@@ -291,14 +291,14 @@ static void free_multiformat_buffer_on_node(void *data_interface, uint32_t node)
 	struct starpu_multiformat_interface *multiformat_interface;
 	multiformat_interface = (struct starpu_multiformat_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->cpu_ptr);
+	starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->cpu_ptr);
 	multiformat_interface->cpu_ptr = NULL;
 #ifdef STARPU_USE_CUDA
-	_starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->cuda_ptr);
+	starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->cuda_ptr);
 	multiformat_interface->cuda_ptr = NULL;
 #endif
 #ifdef STARPU_USE_OPENCL
-	_starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->opencl_ptr);
+	starpu_free_buffer_on_node(node, (uintptr_t) multiformat_interface->opencl_ptr);
 	multiformat_interface->opencl_ptr = NULL;
 #endif
 }

+ 2 - 2
src/datawizard/interfaces/variable_interface.c

@@ -201,7 +201,7 @@ static ssize_t allocate_variable_buffer_on_node(void *data_interface_, uint32_t
 {
 	struct starpu_variable_interface *variable_interface = (struct starpu_variable_interface *) data_interface_;
 	size_t elemsize = variable_interface->elemsize;
-	uintptr_t addr = _starpu_allocate_buffer_on_node(dst_node, elemsize);
+	uintptr_t addr = starpu_allocate_buffer_on_node(dst_node, elemsize);
 
 	if (!addr)
 		return -ENOMEM;
@@ -214,7 +214,7 @@ static ssize_t allocate_variable_buffer_on_node(void *data_interface_, uint32_t
 
 static void free_variable_buffer_on_node(void *data_interface, uint32_t node)
 {
-	_starpu_free_buffer_on_node(STARPU_VARIABLE_GET_PTR(data_interface), node);
+	starpu_free_buffer_on_node(STARPU_VARIABLE_GET_PTR(data_interface), node);
 }
 
 #ifdef STARPU_USE_CUDA

+ 2 - 2
src/datawizard/interfaces/vector_interface.c

@@ -242,7 +242,7 @@ static ssize_t allocate_vector_buffer_on_node(void *data_interface_, uint32_t ds
 
 	ssize_t allocated_memory;
 
-	handle = _starpu_allocate_buffer_on_node(dst_node, nx*elemsize);
+	handle = starpu_allocate_buffer_on_node(dst_node, nx*elemsize);
 	if (!handle)
 		return -ENOMEM;
 
@@ -263,7 +263,7 @@ static void free_vector_buffer_on_node(void *data_interface, uint32_t node)
 {
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *) data_interface;
 
-	_starpu_free_buffer_on_node(node, vector_interface->ptr);
+	starpu_free_buffer_on_node(node, vector_interface->ptr);
 }
 
 #ifdef STARPU_USE_CUDA

+ 2 - 2
src/datawizard/memalloc.c

@@ -751,7 +751,7 @@ static size_t _starpu_get_global_mem_size(int dst_node)
 }
 
 uintptr_t
-_starpu_allocate_buffer_on_node(uint32_t dst_node, size_t size)
+starpu_allocate_buffer_on_node(uint32_t dst_node, size_t size)
 {
 	uintptr_t addr = 0;
 
@@ -797,7 +797,7 @@ _starpu_allocate_buffer_on_node(uint32_t dst_node, size_t size)
 }
 
 void
-_starpu_free_buffer_on_node(uint32_t dst_node, uintptr_t addr)
+starpu_free_buffer_on_node(uint32_t dst_node, uintptr_t addr)
 {
 	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 	switch(kind)

+ 0 - 2
src/datawizard/memalloc.h

@@ -60,8 +60,6 @@ void _starpu_init_mem_chunk_lists(void);
 void _starpu_deinit_mem_chunk_lists(void);
 void _starpu_request_mem_chunk_removal(starpu_data_handle_t handle, unsigned node, int handle_deleted);
 int _starpu_allocate_memory_on_node(starpu_data_handle_t handle, struct _starpu_data_replicate *replicate, unsigned is_prefetch);
-uintptr_t _starpu_allocate_buffer_on_node(uint32_t dst_node, size_t size);
-void _starpu_free_buffer_on_node(uint32_t dst_node, uintptr_t addr);
 size_t _starpu_free_all_automatically_allocated_buffers(uint32_t node);
 void _starpu_memchunk_recently_used(struct _starpu_mem_chunk *mc, unsigned node);