Browse Source

Rename starpu_get_node_kind : it should be starpu_node_get_kind.

Cyril Roelandt 13 years ago
parent
commit
ee3612515d

+ 1 - 1
include/starpu_data.h

@@ -100,7 +100,7 @@ enum starpu_node_kind
 
 unsigned starpu_worker_get_memory_node(unsigned workerid);
 unsigned starpu_memory_nodes_get_count(void);
-enum starpu_node_kind starpu_get_node_kind(uint32_t node);
+enum starpu_node_kind starpu_node_get_kind(uint32_t node);
 
 
 /* It is possible to associate a mask to a piece of data (and its children) so

+ 2 - 2
src/core/sched_policy.c

@@ -351,7 +351,7 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 
 	/* The node does not really matter here */
 	format_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, 0);
-	node_kind = starpu_get_node_kind(node);
+	node_kind = starpu_node_get_kind(node);
 
 	handle->refcnt++;
 	handle->busy_count++;
@@ -359,7 +359,7 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 	switch(node_kind)
 	{
 	case STARPU_CPU_RAM:
-		switch (starpu_get_node_kind(handle->mf_node))
+		switch (starpu_node_get_kind(handle->mf_node))
 		{
 		case STARPU_CPU_RAM:
 			STARPU_ASSERT(0);

+ 3 - 3
src/core/task.c

@@ -675,7 +675,7 @@ _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
 {
 	enum starpu_node_kind node_kind;
 
-	node_kind = starpu_get_node_kind(node);
+	node_kind = starpu_node_get_kind(node);
 
 	/*
 	 * Here, we assume that CUDA devices and OpenCL devices use the 
@@ -685,7 +685,7 @@ _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
 	switch (node_kind)
 	{
 		case STARPU_CPU_RAM:
-			switch(starpu_get_node_kind(handle->mf_node))
+			switch(starpu_node_get_kind(handle->mf_node))
 			{
 				case STARPU_CPU_RAM:
 					return 0;
@@ -699,7 +699,7 @@ _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
 			break;
 		case STARPU_CUDA_RAM:    /* Fall through */
 		case STARPU_OPENCL_RAM:
-			switch(starpu_get_node_kind(handle->mf_node))
+			switch(starpu_node_get_kind(handle->mf_node))
 			{
 				case STARPU_CPU_RAM:
 					return 1;

+ 6 - 6
src/datawizard/coherency.c

@@ -99,9 +99,9 @@ uint32_t _starpu_select_src_node(starpu_data_handle_t handle, unsigned destinati
 
 			if (
 #ifndef HAVE_CUDA_MEMCPY_PEER
-					starpu_get_node_kind(i) != STARPU_CUDA_RAM &&
+					starpu_node_get_kind(i) != STARPU_CUDA_RAM &&
 #endif
-					starpu_get_node_kind(i) != STARPU_OPENCL_RAM)
+					starpu_node_get_kind(i) != STARPU_OPENCL_RAM)
 				break ;
 		}
 	}
@@ -162,14 +162,14 @@ static int worker_supports_direct_access(unsigned node, unsigned handling_node)
 		/* No worker to process the request from that node */
 		return 0;
 
-	int type = starpu_get_node_kind(node);
+	int type = starpu_node_get_kind(node);
 	switch (type)
 	{
 		case STARPU_CUDA_RAM:
 #ifdef HAVE_CUDA_MEMCPY_PEER
 			/* GPUs not always allow direct remote access: if CUDA4
 			 * is enabled, we allow two CUDA devices to communicate. */
-			return (starpu_get_node_kind(handling_node) != STARPU_OPENCL_RAM);
+			return (starpu_node_get_kind(handling_node) != STARPU_OPENCL_RAM);
 #else
 			/* Direct GPU-GPU transfers are not allowed in general */
 			return 0;
@@ -187,7 +187,7 @@ static int link_supports_direct_transfers(starpu_data_handle_t handle, unsigned
 	 * Perhaps not all data interface provide a direct GPU-GPU transfer
 	 * method ! */
 #ifdef STARPU_USE_CUDA
-	if (src_node != dst_node && starpu_get_node_kind(src_node) == STARPU_CUDA_RAM && starpu_get_node_kind(dst_node) == STARPU_CUDA_RAM)
+	if (src_node != dst_node && starpu_node_get_kind(src_node) == STARPU_CUDA_RAM && starpu_node_get_kind(dst_node) == STARPU_CUDA_RAM)
 	{
 		const struct starpu_data_copy_methods *copy_methods = handle->ops->copy_methods;
 		if (!copy_methods->cuda_to_cuda_async)
@@ -262,7 +262,7 @@ static int determine_request_path(starpu_data_handle_t handle,
 		handling_nodes[0] = handling_node;
 
 #ifndef HAVE_CUDA_MEMCPY_PEER
-		STARPU_ASSERT(!(mode & STARPU_R) || starpu_get_node_kind(src_node) != STARPU_CUDA_RAM || starpu_get_node_kind(dst_node) != STARPU_CUDA_RAM);
+		STARPU_ASSERT(!(mode & STARPU_R) || starpu_node_get_kind(src_node) != STARPU_CUDA_RAM || starpu_node_get_kind(dst_node) != STARPU_CUDA_RAM);
 #endif
 
 		return 1;

+ 2 - 2
src/datawizard/copy_driver.c

@@ -94,8 +94,8 @@ static int copy_data_1_to_1_generic(starpu_data_handle_t handle,
 	unsigned src_node = src_replicate->memory_node;
 	unsigned dst_node = dst_replicate->memory_node;
 
-	enum starpu_node_kind src_kind = starpu_get_node_kind(src_node);
-	enum starpu_node_kind dst_kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind src_kind = starpu_node_get_kind(src_node);
+	enum starpu_node_kind dst_kind = starpu_node_get_kind(dst_node);
 
 	STARPU_ASSERT(src_replicate->refcnt);
 	STARPU_ASSERT(dst_replicate->refcnt);

+ 1 - 1
src/datawizard/filters.c

@@ -271,7 +271,7 @@ void starpu_data_unpartition(starpu_data_handle_t root_handle, uint32_t gatherin
 		/* If this is a multiformat handle, we must convert the data now */
 		unsigned int id = starpu_get_handle_interface_id(child_handle);
 		if (id == STARPU_MULTIFORMAT_INTERFACE_ID &&
-			starpu_get_node_kind(child_handle->mf_node) != STARPU_CPU_RAM)
+			starpu_node_get_kind(child_handle->mf_node) != STARPU_CPU_RAM)
 		{
 			struct starpu_codelet cl =
 			{

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

@@ -275,7 +275,7 @@ 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;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 	switch(kind)
 	{
@@ -393,7 +393,7 @@ 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;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

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

@@ -307,7 +307,7 @@ static ssize_t allocate_block_buffer_on_node(void *data_interface_, uint32_t dst
 	uint32_t nz = dst_block->nz;
 	size_t elemsize = dst_block->elemsize;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 	switch(kind)
 	{
@@ -381,7 +381,7 @@ static void free_block_buffer_on_node(void *data_interface, uint32_t node)
 	cudaError_t status;
 #endif
 
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

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

@@ -249,7 +249,7 @@ 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;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 	switch(kind)
 	{
@@ -367,7 +367,7 @@ 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;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

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

@@ -456,14 +456,14 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 		 */
 		enum starpu_data_interface_id id = starpu_get_handle_interface_id(handle);
 		if (id == STARPU_MULTIFORMAT_INTERFACE_ID &&
-			starpu_get_node_kind(handle->mf_node) != STARPU_CPU_RAM)
+			starpu_node_get_kind(handle->mf_node) != STARPU_CPU_RAM)
 		{
 			_STARPU_DEBUG("Conversion needed\n");
 			void *buffers[1];
 			struct starpu_multiformat_interface *format_interface;
 			format_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, 0);
 			struct starpu_codelet *cl;
-			enum starpu_node_kind node_kind = starpu_get_node_kind(handle->mf_node);
+			enum starpu_node_kind node_kind = starpu_node_get_kind(handle->mf_node);
 
 			switch (node_kind)
 			{

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

@@ -287,7 +287,7 @@ static ssize_t allocate_matrix_buffer_on_node(void *data_interface_, uint32_t ds
 	uint32_t ld = nx; // by default
 	size_t elemsize = matrix_interface->elemsize;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 	switch(kind)
 	{
@@ -359,7 +359,7 @@ static void free_matrix_buffer_on_node(void *data_interface, uint32_t node)
 	cudaError_t status;
 #endif
 
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

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

@@ -104,7 +104,7 @@ static void *multiformat_handle_to_pointer(starpu_data_handle_t handle, uint32_t
 	struct starpu_multiformat_interface *multiformat_interface =
 		(struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, node);
 
-	switch(starpu_get_node_kind(node))
+	switch(starpu_node_get_kind(node))
 	{
 		case STARPU_CPU_RAM:
 			return multiformat_interface->cpu_ptr;
@@ -242,7 +242,7 @@ 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;
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 
 	switch(kind)
 	{
@@ -282,7 +282,7 @@ static ssize_t allocate_multiformat_buffer_on_node(void *data_interface_, uint32
 	uintptr_t addr = 0;
 	ssize_t allocated_memory;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

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

@@ -207,7 +207,7 @@ static ssize_t allocate_variable_buffer_on_node(void *data_interface_, uint32_t
 
 	size_t elemsize = variable_interface->elemsize;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 #ifdef STARPU_USE_CUDA
 	cudaError_t status;
@@ -264,7 +264,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)
 {
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

+ 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
 	uint32_t nx = vector_interface->nx;
 	size_t elemsize = vector_interface->elemsize;
 
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 
 #ifdef STARPU_USE_CUDA
 	cudaError_t status;
@@ -308,7 +308,7 @@ static void free_vector_buffer_on_node(void *data_interface, uint32_t node)
 	cudaError_t cures;
 #endif
 
-	enum starpu_node_kind kind = starpu_get_node_kind(node);
+	enum starpu_node_kind kind = starpu_node_get_kind(node);
 	switch(kind)
 	{
 		case STARPU_CPU_RAM:

+ 3 - 3
src/datawizard/memalloc.c

@@ -241,7 +241,7 @@ static size_t free_memory_on_node(struct _starpu_mem_chunk *mc, uint32_t node)
 			STARPU_ASSERT(replicate->allocated);
 
 #if defined(STARPU_USE_CUDA) && defined(HAVE_CUDA_MEMCPY_PEER)
-		if (starpu_get_node_kind(node) == STARPU_CUDA_RAM)
+		if (starpu_node_get_kind(node) == STARPU_CUDA_RAM)
 		{
 			/* To facilitate the design of interface, we set the
 			 * proper CUDA device in case it is needed. This avoids
@@ -700,7 +700,7 @@ void _starpu_request_mem_chunk_removal(starpu_data_handle_t handle, unsigned nod
 
 static size_t _starpu_get_global_mem_size(int dst_node)
 {
-	enum starpu_node_kind kind = starpu_get_node_kind(dst_node);
+	enum starpu_node_kind kind = starpu_node_get_kind(dst_node);
 	size_t global_mem_size;
 
 	switch(kind)
@@ -780,7 +780,7 @@ static ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, struct _s
 		STARPU_ASSERT(replicate->data_interface);
 
 #if defined(STARPU_USE_CUDA) && defined(HAVE_CUDA_MEMCPY_PEER)
-		if (starpu_get_node_kind(dst_node) == STARPU_CUDA_RAM)
+		if (starpu_node_get_kind(dst_node) == STARPU_CUDA_RAM)
 		{
 			/* To facilitate the design of interface, we set the
 			 * proper CUDA device in case it is needed. This avoids

+ 1 - 1
src/datawizard/memory_nodes.c

@@ -89,7 +89,7 @@ struct _starpu_mem_node_descr *_starpu_get_memory_node_description(void)
 	return &descr;
 }
 
-enum starpu_node_kind starpu_get_node_kind(uint32_t node)
+enum starpu_node_kind starpu_node_get_kind(uint32_t node)
 {
 	return descr.nodes[node];
 }

+ 1 - 1
src/datawizard/memory_nodes.h

@@ -69,7 +69,7 @@ unsigned _starpu_register_memory_node(enum starpu_node_kind kind, int devid);
 //void _starpu_memory_node_attach_queue(struct starpu_jobq_s *q, unsigned nodeid);
 void _starpu_memory_node_register_condition(pthread_cond_t *cond, pthread_mutex_t *mutex, unsigned memory_node);
 
-enum starpu_node_kind _starpu_get_node_kind(uint32_t node);
+enum starpu_node_kind _starpu_node_get_kind(uint32_t node);
 int _starpu_memory_node_to_devid(unsigned node);
 
 struct _starpu_mem_node_descr *_starpu_get_memory_node_description(void);

+ 1 - 1
tests/datawizard/interfaces/test_interfaces.c

@@ -655,7 +655,7 @@ handle_to_pointer(void)
 
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		if (starpu_get_node_kind(node) != STARPU_CPU_RAM)
+		if (starpu_node_get_kind(node) != STARPU_CPU_RAM)
 			continue;
 
 		ptr = handle->ops->handle_to_pointer(handle, node);