Explorar el Código

Minor cleanups:
- make static some functions who need not be exported
- prefix with _starpu those who cannot be made static

Cédric Augonnet hace 15 años
padre
commit
0548a0dd12

+ 2 - 2
examples/pastix-wrappers/starpu-blas-wrapper.c

@@ -40,7 +40,7 @@
 
 #include "starpu-blas-wrapper.h"
 
-extern struct starpu_data_interface_ops_t interface_blas_ops;
+extern struct starpu_data_interface_ops_t _starpu_interface_blas_ops;
 
 static int cpu_sgemm = 0;
 static int cublas_sgemm = 0;
@@ -146,7 +146,7 @@ void divide_vector_in_blas_filter(starpu_filter *f, starpu_data_handle root_data
 		}
 
 		struct starpu_data_state_t *state = &root_data->children[child];
-		state->ops = &interface_blas_ops;
+		state->ops = &_starpu_interface_blas_ops;
 	}
 
 	child++;

+ 1 - 1
src/core/mechanisms/deque_queues.c

@@ -166,7 +166,7 @@ starpu_job_t _starpu_deque_pop_task(struct starpu_jobq_s *q)
 	return j;
 }
 
-struct starpu_job_list_s * deque_pop_every_task(struct starpu_jobq_s *q, uint32_t where)
+struct starpu_job_list_s * _starpu_deque_pop_every_task(struct starpu_jobq_s *q, uint32_t where)
 {
 	struct starpu_job_list_s *new_list, *old_list;
 

+ 1 - 1
src/core/policies/deque-modeling-policy-data-aware.c

@@ -249,7 +249,7 @@ static struct starpu_jobq_s *get_local_queue_dmda(struct starpu_sched_policy_s *
 	return queue;
 }
 
-struct starpu_sched_policy_s sched_dmda_policy = {
+struct starpu_sched_policy_s _starpu_sched_dmda_policy = {
 	.init_sched = initialize_dmda_policy,
 	.deinit_sched = deinitialize_dmda_policy,
 	._starpu_get_local_queue = get_local_queue_dmda,

+ 1 - 1
src/core/policies/deque-modeling-policy-data-aware.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct starpu_sched_policy_s sched_dmda_policy;
+extern struct starpu_sched_policy_s _starpu_sched_dmda_policy;
 
 #endif // __DEQUE_MODELING_POLICY_DATA_AWARE_H__

+ 1 - 1
src/core/policies/deque-modeling-policy.c

@@ -205,7 +205,7 @@ static struct starpu_jobq_s *get_local_queue_dm(struct starpu_sched_policy_s *po
 	return queue;
 }
 
-struct starpu_sched_policy_s sched_dm_policy = {
+struct starpu_sched_policy_s _starpu_sched_dm_policy = {
 	.init_sched = initialize_dm_policy,
 	.deinit_sched = deinitialize_dm_policy,
 	._starpu_get_local_queue = get_local_queue_dm,

+ 1 - 1
src/core/policies/deque-modeling-policy.h

@@ -22,6 +22,6 @@
 #include <core/mechanisms/fifo_queues.h>
 #include <core/mechanisms/deque_queues.h>
 
-extern struct starpu_sched_policy_s sched_dm_policy;
+extern struct starpu_sched_policy_s _starpu_sched_dm_policy;
 
 #endif // __DEQUE_MODELING_POLICY_H__

+ 1 - 1
src/core/policies/eager-central-policy.c

@@ -72,7 +72,7 @@ static struct starpu_jobq_s *get_local_queue_eager(struct starpu_sched_policy_s
 	return jobq;
 }
 
-struct starpu_sched_policy_s sched_eager_policy = {
+struct starpu_sched_policy_s _starpu_sched_eager_policy = {
 	.init_sched = initialize_eager_center_policy,
 	.deinit_sched = deinitialize_eager_center_policy,
 	._starpu_get_local_queue = get_local_queue_eager,

+ 1 - 1
src/core/policies/eager-central-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct starpu_sched_policy_s sched_eager_policy;
+extern struct starpu_sched_policy_s _starpu_sched_eager_policy;
 
 #endif // __EAGER_CENTRAL_POLICY_H__

+ 1 - 1
src/core/policies/eager-central-priority-policy.c

@@ -64,7 +64,7 @@ static struct starpu_jobq_s *get_local_queue_eager_priority(struct starpu_sched_
 	return jobq;
 }
 
-struct starpu_sched_policy_s sched_prio_policy = {
+struct starpu_sched_policy_s _starpu_sched_prio_policy = {
 	.init_sched = initialize_eager_center_priority_policy,
 	.deinit_sched = deinitialize_eager_center_priority_policy,
 	._starpu_get_local_queue = get_local_queue_eager_priority,

+ 1 - 1
src/core/policies/eager-central-priority-policy.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/priority_queues.h>
 
-extern struct starpu_sched_policy_s sched_prio_policy;
+extern struct starpu_sched_policy_s _starpu_sched_prio_policy;
 
 #endif // __EAGER_CENTRAL_PRIORITY_POLICY_H__

+ 3 - 3
src/core/policies/no-prio-policy.c

@@ -43,20 +43,20 @@ static struct starpu_jobq_s *func_init_central_queue(void)
 	return jobq;
 }
 
-void initialize_no_prio_policy(struct starpu_machine_config_s *config, 
+static void initialize_no_prio_policy(struct starpu_machine_config_s *config, 
 	   __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	_starpu_setup_queues(init_no_prio_design, func_init_central_queue, config);
 }
 
-struct starpu_jobq_s *get_local_queue_no_prio(struct starpu_sched_policy_s *policy 
+static struct starpu_jobq_s *get_local_queue_no_prio(struct starpu_sched_policy_s *policy 
 					__attribute__ ((unused)))
 {
 	/* this is trivial for that strategy :) */
 	return jobq;
 }
 
-struct starpu_sched_policy_s sched_no_prio_policy = {
+struct starpu_sched_policy_s _starpu_sched_no_prio_policy = {
 	.init_sched = initialize_no_prio_policy,
 	.deinit_sched = NULL,
 	._starpu_get_local_queue = get_local_queue_no_prio,

+ 1 - 1
src/core/policies/no-prio-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct starpu_sched_policy_s sched_no_prio_policy;
+extern struct starpu_sched_policy_s _starpu_sched_no_prio_policy;
 
 #endif // __NO_PRIO_POLICY_H__

+ 1 - 1
src/core/policies/random-policy.c

@@ -119,7 +119,7 @@ static struct starpu_jobq_s *get_local_queue_random(struct starpu_sched_policy_s
 	return queue;
 }
 
-struct starpu_sched_policy_s sched_random_policy = {
+struct starpu_sched_policy_s _starpu_sched_random_policy = {
 	.init_sched = initialize_random_policy,
 	.deinit_sched = NULL,
 	._starpu_get_local_queue = get_local_queue_random,

+ 1 - 1
src/core/policies/random-policy.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct starpu_sched_policy_s sched_random_policy;
+extern struct starpu_sched_policy_s _starpu_sched_random_policy;
 
 #endif // __RANDOM_POLICY_H__

+ 9 - 9
src/core/policies/sched_policy.c

@@ -38,14 +38,14 @@ static int use_prefetch = 0;
 
 #define NPREDEFINED_POLICIES	7
 
-struct starpu_sched_policy_s *predefined_policies[NPREDEFINED_POLICIES] = {
-	&sched_ws_policy,
-	&sched_prio_policy,
-	&sched_no_prio_policy,
-	&sched_dm_policy,
-	&sched_dmda_policy,
-	&sched_random_policy,
-	&sched_eager_policy
+static struct starpu_sched_policy_s *predefined_policies[NPREDEFINED_POLICIES] = {
+	&_starpu_sched_ws_policy,
+	&_starpu_sched_prio_policy,
+	&_starpu_sched_no_prio_policy,
+	&_starpu_sched_dm_policy,
+	&_starpu_sched_dmda_policy,
+	&_starpu_sched_random_policy,
+	&_starpu_sched_eager_policy
 };
 
 struct starpu_sched_policy_s *_starpu_get_sched_policy(void)
@@ -152,7 +152,7 @@ static struct starpu_sched_policy_s *select_sched_policy(struct starpu_machine_c
 		return selected_policy;
 
 	/* If no policy was specified, we use the greedy policy as a default */
-	return &sched_eager_policy;
+	return &_starpu_sched_eager_policy;
 }
 
 void _starpu_init_sched_policy(struct starpu_machine_config_s *config)

+ 1 - 1
src/core/policies/work-stealing-policy.c

@@ -199,7 +199,7 @@ static struct starpu_jobq_s *get_local_queue_ws(struct starpu_sched_policy_s *po
 	return queue;
 }
 
-struct starpu_sched_policy_s sched_ws_policy = {
+struct starpu_sched_policy_s _starpu_sched_ws_policy = {
 	.init_sched = initialize_ws_policy,
 	.deinit_sched = NULL,
 	._starpu_get_local_queue = get_local_queue_ws,

+ 1 - 1
src/core/policies/work-stealing-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/deque_queues.h>
 
-extern struct starpu_sched_policy_s sched_ws_policy;
+extern struct starpu_sched_policy_s _starpu_sched_ws_policy;
 
 #endif // __WORK_STEALING_POLICY_H__

+ 1 - 3
src/datawizard/interfaces/bcsr_filters.c

@@ -18,8 +18,6 @@
 #include <common/config.h>
 #include <datawizard/hierarchy.h>
 
-extern struct starpu_data_interface_ops_t interface_blas_ops;
-
 void starpu_canonical_block_filter_bcsr(starpu_filter *f __attribute__((unused)), starpu_data_handle root_handle)
 {
 	unsigned nchunks;
@@ -40,7 +38,7 @@ void starpu_canonical_block_filter_bcsr(starpu_filter *f __attribute__((unused))
 	nchunks = nnz;
 	
 	/* first allocate the children : it's a set of BLAS !*/
-	starpu_data_create_children(root_handle, nchunks, &interface_blas_ops);
+	starpu_data_create_children(root_handle, nchunks, &_starpu_interface_blas_ops);
 
 	/* actually create all the chunks */
 

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

@@ -52,7 +52,7 @@ static void liberate_bcsr_buffer_on_node(void *interface, uint32_t node);
 static size_t bcsr_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_bcsr_interface_crc32(starpu_data_handle handle);
 
-struct starpu_data_interface_ops_t interface_bcsr_ops = {
+static struct starpu_data_interface_ops_t interface_bcsr_ops = {
 	.register_data_handle = register_bcsr_handle,
 	.allocate_data_on_node = allocate_bcsr_buffer_on_node,
 	.liberate_data_on_node = liberate_bcsr_buffer_on_node,

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

@@ -61,7 +61,7 @@ static void display_blas_interface(starpu_data_handle handle, FILE *f);
 static int convert_blas_to_gordon(void *interface, uint64_t *ptr, gordon_strideSize_t *ss); 
 #endif
 
-struct starpu_data_interface_ops_t interface_blas_ops = {
+struct starpu_data_interface_ops_t _starpu_interface_blas_ops = {
 	.register_data_handle = register_blas_handle,
 	.allocate_data_on_node = allocate_blas_buffer_on_node,
 	.liberate_data_on_node = liberate_blas_buffer_on_node,
@@ -132,7 +132,7 @@ void starpu_register_blas_data(starpu_data_handle *handleptr, uint32_t home_node
 		.elemsize = elemsize
 	};
 
-	_starpu_register_data_handle(handleptr, home_node, &interface, &interface_blas_ops);
+	_starpu_register_data_handle(handleptr, home_node, &interface, &_starpu_interface_blas_ops);
 }
 
 static uint32_t footprint_blas_interface_crc32(starpu_data_handle handle)

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

@@ -57,7 +57,7 @@ static void display_block_interface(starpu_data_handle handle, FILE *f);
 static int convert_block_to_gordon(void *interface, uint64_t *ptr, gordon_strideSize_t *ss);
 #endif
 
-struct starpu_data_interface_ops_t interface_block_ops = {
+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,
 	.liberate_data_on_node = liberate_block_buffer_on_node,

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

@@ -49,7 +49,7 @@ static void liberate_csr_buffer_on_node(void *interface, uint32_t node);
 static size_t csr_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_csr_interface_crc32(starpu_data_handle handle);
 
-struct starpu_data_interface_ops_t interface_csr_ops = {
+static struct starpu_data_interface_ops_t interface_csr_ops = {
 	.register_data_handle = register_csr_handle,
 	.allocate_data_on_node = allocate_csr_buffer_on_node,
 	.liberate_data_on_node = liberate_csr_buffer_on_node,

+ 3 - 0
src/datawizard/interfaces/data_interface.h

@@ -46,4 +46,7 @@ void _starpu_register_data_handle(starpu_data_handle *handleptr, uint32_t home_n
 				void *interface,
 				struct starpu_data_interface_ops_t *ops);
 
+/* Some data interfaces or filters use this interface internally */
+extern struct starpu_data_interface_ops_t _starpu_interface_blas_ops;
+
 #endif // __DATA_INTERFACE_H__

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

@@ -60,7 +60,7 @@ static void display_vector_interface(starpu_data_handle handle, FILE *f);
 static int convert_vector_to_gordon(void *interface, uint64_t *ptr, gordon_strideSize_t *ss); 
 #endif
 
-struct starpu_data_interface_ops_t interface_vector_ops = {
+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,
 	.liberate_data_on_node = liberate_vector_buffer_on_node,