Forráskód Böngészése

src: declare related driver functions in appropriate .h file

Nathalie Furmento 13 éve
szülő
commit
8b00244b60

+ 4 - 26
src/core/workers.c

@@ -27,6 +27,10 @@
 #include <profiling/profiling.h>
 #include <starpu_task_list.h>
 
+#include <drivers/cpu/driver_cpu.h>
+#include <drivers/cuda/driver_cuda.h>
+#include <drivers/opencl/driver_opencl.h>
+
 #ifdef __MINGW32__
 #include <windows.h>
 #endif
@@ -1007,16 +1011,6 @@ void starpu_worker_set_sched_condition(int workerid, pthread_cond_t *sched_cond,
 	config.workers[workerid].sched_mutex = sched_mutex;
 }
 
-#ifdef STARPU_USE_CPU
-extern int _starpu_run_cpu(struct starpu_driver *);
-#endif
-#ifdef STARPU_USE_CUDA
-extern int _starpu_run_cuda(struct starpu_driver *);
-#endif
-#ifdef STARPU_USE_OPENCL
-extern int _starpu_run_opencl(struct starpu_driver *);
-#endif
-
 int
 starpu_driver_run(struct starpu_driver *d)
 {
@@ -1043,22 +1037,6 @@ starpu_driver_run(struct starpu_driver *d)
 	}
 }
 
-#ifdef STARPU_USE_CPU
-extern int _starpu_cpu_driver_init(struct starpu_driver *);
-extern int _starpu_cpu_driver_run_once(struct starpu_driver *);
-extern int _starpu_cpu_driver_deinit(struct starpu_driver *);
-#endif
-#ifdef STARPU_USE_CUDA
-extern int _starpu_cuda_driver_init(struct starpu_driver *);
-extern int _starpu_cuda_driver_run_once(struct starpu_driver *);
-extern int _starpu_cuda_driver_deinit(struct starpu_driver *);
-#endif
-#ifdef STARPU_USE_OPENCL
-extern int _starpu_opencl_driver_init(struct starpu_driver *);
-extern int _starpu_opencl_driver_run_once(struct starpu_driver *);
-extern int _starpu_opencl_driver_deinit(struct starpu_driver *);
-#endif
-
 int
 starpu_driver_init(struct starpu_driver *d)
 {

+ 5 - 1
src/drivers/cpu/driver_cpu.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -29,5 +29,9 @@
 #include <starpu.h>
 
 void *_starpu_cpu_worker(void *);
+int _starpu_run_cpu(struct starpu_driver *);
+int _starpu_cpu_driver_init(struct starpu_driver *);
+int _starpu_cpu_driver_run_once(struct starpu_driver *);
+int _starpu_cpu_driver_deinit(struct starpu_driver *);
 
 #endif //  __DRIVER_CPU_H__

+ 6 - 1
src/drivers/cuda/driver_cuda.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -44,6 +44,11 @@ unsigned _starpu_get_cuda_device_count(void);
 void _starpu_init_cuda(void);
 void *_starpu_cuda_worker(void *);
 cudaStream_t starpu_cuda_get_local_transfer_stream(void);
+
+int _starpu_run_cuda(struct starpu_driver *);
+int _starpu_cuda_driver_init(struct starpu_driver *);
+int _starpu_cuda_driver_run_once(struct starpu_driver *);
+int _starpu_cuda_driver_deinit(struct starpu_driver *);
 #endif
 
 #endif //  __DRIVER_CUDA_H__

+ 13 - 1
src/drivers/opencl/driver_opencl.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -60,5 +60,17 @@ void _starpu_opencl_init(void);
 extern
 void *_starpu_opencl_worker(void *);
 
+extern
+int _starpu_run_opencl(struct starpu_driver *);
+
+extern
+int _starpu_opencl_driver_init(struct starpu_driver *);
+
+extern
+int _starpu_opencl_driver_run_once(struct starpu_driver *);
+
+extern
+int _starpu_opencl_driver_deinit(struct starpu_driver *);
+
 #endif // STARPU_USE_OPENCL
 #endif //  __DRIVER_OPENCL_H__