Browse Source

src: prefix internal type names with _

Nathalie Furmento 4 years ago
parent
commit
7a4925d12b

+ 2 - 2
src/core/sched_ctx.c

@@ -2782,7 +2782,7 @@ static void _get_workers(int min, int max, int *workers, int *nw, enum starpu_wo
 	if(config->topology.nsched_ctxs == 1)
 	{
 		/*we have all available resources */
-		npus = starpu_worker_get_nids_by_type(arch, pus, max);
+		npus = _starpu_worker_get_nids_by_type(arch, pus, max);
 /*TODO: hierarchical ctxs: get max good workers: close one to another */
 		for(i = 0; i < npus; i++)
 			workers[(*nw)++] = pus[i];
@@ -2790,7 +2790,7 @@ static void _get_workers(int min, int max, int *workers, int *nw, enum starpu_wo
 	else
 	{
 		unsigned enough_ressources = 0;
-		npus = starpu_worker_get_nids_ctx_free_by_type(arch, pus, max);
+		npus = _starpu_worker_get_nids_ctx_free_by_type(arch, pus, max);
 
 		for(i = 0; i < npus; i++)
 			workers[(*nw)++] = pus[i];

+ 6 - 6
src/core/workers.c

@@ -204,16 +204,16 @@ void _starpu__workers_c__register_kobs(void)
 	/* TODO */
 }
 
-struct starpu_driver_info starpu_driver_info[STARPU_NARCH];
+struct _starpu_driver_info starpu_driver_info[STARPU_NARCH];
 
-void starpu_driver_info_register(enum starpu_worker_archtype archtype, const struct starpu_driver_info *info)
+void _starpu_driver_info_register(enum starpu_worker_archtype archtype, const struct _starpu_driver_info *info)
 {
 	starpu_driver_info[archtype] = *info;
 }
 
-struct starpu_memory_driver_info starpu_memory_driver_info[STARPU_MAX_RAM+1];
+struct _starpu_memory_driver_info starpu_memory_driver_info[STARPU_MAX_RAM+1];
 
-void starpu_memory_driver_info_register(enum starpu_node_kind kind, const struct starpu_memory_driver_info *info)
+void _starpu_memory_driver_info_register(enum starpu_node_kind kind, const struct _starpu_memory_driver_info *info)
 {
 	starpu_memory_driver_info[kind] = *info;
 }
@@ -2436,7 +2436,7 @@ int starpu_wake_worker_no_relax(int workerid)
 	return starpu_wakeup_worker_no_relax(workerid, sched_cond, sched_mutex);
 }
 
-int starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
+int _starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
 {
 	unsigned nworkers = starpu_worker_get_count();
 
@@ -2458,7 +2458,7 @@ int starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *worker
 	return cnt;
 }
 
-int starpu_worker_get_nids_ctx_free_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
+int _starpu_worker_get_nids_ctx_free_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
 {
 	unsigned nworkers = starpu_worker_get_count();
 	int cnt = 0;

+ 8 - 8
src/core/workers.h

@@ -399,7 +399,7 @@ struct _starpu_machine_config
 };
 
 /** Provides information for a device driver */
-struct starpu_driver_info
+struct _starpu_driver_info
 {
 	const char *name_upper;	/**< Name of worker type in upper case */
 	const char *name_var;	/**< Name of worker type for environment variables */
@@ -409,21 +409,21 @@ struct starpu_driver_info
 };
 
 /** Device driver information, indexed by enum starpu_worker_archtype */
-extern struct starpu_driver_info starpu_driver_info[STARPU_NARCH];
+extern struct _starpu_driver_info starpu_driver_info[STARPU_NARCH];
 
-void starpu_driver_info_register(enum starpu_worker_archtype archtype, const struct starpu_driver_info *info);
+void _starpu_driver_info_register(enum starpu_worker_archtype archtype, const struct _starpu_driver_info *info);
 
 /** Provides information for a memory node driver */
-struct starpu_memory_driver_info
+struct _starpu_memory_driver_info
 {
 	const char *name_upper;	/**< Name of memory in upper case */
 	enum starpu_worker_archtype worker_archtype;	/**< Kind of device */
 };
 
 /** Memory driver information, indexed by enum starpu_node_kind */
-extern struct starpu_memory_driver_info starpu_memory_driver_info[STARPU_MAX_RAM+1];
+extern struct _starpu_memory_driver_info starpu_memory_driver_info[STARPU_MAX_RAM+1];
 
-void starpu_memory_driver_info_register(enum starpu_node_kind kind, const struct starpu_memory_driver_info *info);
+void _starpu_memory_driver_info_register(enum starpu_node_kind kind, const struct _starpu_memory_driver_info *info);
 
 extern int _starpu_worker_parallel_blocks;
 
@@ -577,11 +577,11 @@ static inline struct _starpu_sched_ctx* _starpu_get_initial_sched_ctx(void)
 	return &_starpu_config.sched_ctxs[STARPU_GLOBAL_SCHED_CTX];
 }
 
-int starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
+int _starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
 
 /** returns workers not belonging to any context, be careful no mutex is used,
    the list might not be updated */
-int starpu_worker_get_nids_ctx_free_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
+int _starpu_worker_get_nids_ctx_free_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
 
 static inline unsigned _starpu_worker_mutex_is_sched_mutex(int workerid, starpu_pthread_mutex_t *mutex)
 {

+ 4 - 4
src/drivers/cpu/driver_cpu.c

@@ -59,7 +59,7 @@
 #include <windows.h>
 #endif
 
-static struct starpu_driver_info driver_info =
+static struct _starpu_driver_info driver_info =
 {
 	.name_upper = "CPU",
 	.name_var = "CPU",
@@ -68,7 +68,7 @@ static struct starpu_driver_info driver_info =
 	.alpha = 0.5f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info =
+static struct _starpu_memory_driver_info memory_driver_info =
 {
 	.name_upper = "NUMA",
 	.worker_archtype = STARPU_CPU_WORKER,
@@ -76,8 +76,8 @@ static struct starpu_memory_driver_info memory_driver_info =
 
 void _starpu_cpu_preinit(void)
 {
-	starpu_driver_info_register(STARPU_CPU_WORKER, &driver_info);
-	starpu_memory_driver_info_register(STARPU_CPU_RAM, &memory_driver_info);
+	_starpu_driver_info_register(STARPU_CPU_WORKER, &driver_info);
+	_starpu_memory_driver_info_register(STARPU_CPU_RAM, &memory_driver_info);
 }
 
 

+ 4 - 4
src/drivers/cuda/driver_cuda_init.c

@@ -17,7 +17,7 @@
 #include <core/workers.h>
 #include <drivers/cuda/driver_cuda.h>
 
-static struct starpu_driver_info driver_info =
+static struct _starpu_driver_info driver_info =
 {
 	.name_upper = "CUDA",
 	.name_var = "CUDA",
@@ -26,7 +26,7 @@ static struct starpu_driver_info driver_info =
 	.alpha = 13.33f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info =
+static struct _starpu_memory_driver_info memory_driver_info =
 {
 	.name_upper = "CUDA",
 	.worker_archtype = STARPU_CUDA_WORKER,
@@ -34,6 +34,6 @@ static struct starpu_memory_driver_info memory_driver_info =
 
 void _starpu_cuda_preinit(void)
 {
-	starpu_driver_info_register(STARPU_CUDA_WORKER, &driver_info);
-	starpu_memory_driver_info_register(STARPU_CUDA_RAM, &memory_driver_info);
+	_starpu_driver_info_register(STARPU_CUDA_WORKER, &driver_info);
+	_starpu_memory_driver_info_register(STARPU_CUDA_RAM, &memory_driver_info);
 }

+ 2 - 2
src/drivers/disk/driver_disk.c

@@ -23,7 +23,7 @@
 #include <datawizard/coherency.h>
 #include <datawizard/memory_nodes.h>
 
-static struct starpu_memory_driver_info memory_driver_info =
+static struct _starpu_memory_driver_info memory_driver_info =
 {
 	.name_upper = "Disk",
 	.worker_archtype = (enum starpu_worker_archtype) -1,
@@ -31,7 +31,7 @@ static struct starpu_memory_driver_info memory_driver_info =
 
 void _starpu_disk_preinit(void)
 {
-	starpu_memory_driver_info_register(STARPU_DISK_RAM, &memory_driver_info);
+	_starpu_memory_driver_info_register(STARPU_DISK_RAM, &memory_driver_info);
 }
 
 int _starpu_disk_copy_src_to_disk(void * src, unsigned src_node, void * dst, size_t dst_offset, unsigned dst_node, size_t size, void * async_channel)

+ 4 - 4
src/drivers/mpi/driver_mpi_init.c

@@ -17,7 +17,7 @@
 #include <core/workers.h>
 #include <drivers/mpi/driver_mpi_source.h>
 
-static struct starpu_driver_info driver_info =
+static struct _starpu_driver_info driver_info =
 {
 	.name_upper = "MPI_MS",
 	.name_var = "MPI_MS",
@@ -26,7 +26,7 @@ static struct starpu_driver_info driver_info =
 	.alpha = 1.0f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info =
+static struct _starpu_memory_driver_info memory_driver_info =
 {
 	.name_upper = "MPI_MS",
 	.worker_archtype = STARPU_MPI_MS_WORKER,
@@ -34,6 +34,6 @@ static struct starpu_memory_driver_info memory_driver_info =
 
 void _starpu_mpi_ms_preinit(void)
 {
-	starpu_driver_info_register(STARPU_MPI_MS_WORKER, &driver_info);
-	starpu_memory_driver_info_register(STARPU_MPI_MS_RAM, &memory_driver_info);
+	_starpu_driver_info_register(STARPU_MPI_MS_WORKER, &driver_info);
+	_starpu_memory_driver_info_register(STARPU_MPI_MS_RAM, &memory_driver_info);
 }

+ 4 - 4
src/drivers/opencl/driver_opencl_init.c

@@ -17,7 +17,7 @@
 #include <core/workers.h>
 #include <drivers/opencl/driver_opencl.h>
 
-static struct starpu_driver_info driver_info =
+static struct _starpu_driver_info driver_info =
 {
 	.name_upper = "OpenCL",
 	.name_var = "OPENCL",
@@ -26,7 +26,7 @@ static struct starpu_driver_info driver_info =
 	.alpha = 12.22f,
 };
 
-static struct starpu_memory_driver_info memory_driver_info =
+static struct _starpu_memory_driver_info memory_driver_info =
 {
 	.name_upper = "OpenCL",
 	.worker_archtype = STARPU_OPENCL_WORKER,
@@ -34,6 +34,6 @@ static struct starpu_memory_driver_info memory_driver_info =
 
 void _starpu_opencl_preinit(void)
 {
-	starpu_driver_info_register(STARPU_OPENCL_WORKER, &driver_info);
-	starpu_memory_driver_info_register(STARPU_OPENCL_RAM, &memory_driver_info);
+	_starpu_driver_info_register(STARPU_OPENCL_WORKER, &driver_info);
+	_starpu_memory_driver_info_register(STARPU_OPENCL_RAM, &memory_driver_info);
 }