ソースを参照

even without CPU workers, we need CPU memory transfer functions

Samuel Thibault 6 年 前
コミット
6f27ae9eea
共有3 個のファイルを変更した12 個の追加16 個の削除を含む
  1. 0 2
      src/Makefile.am
  2. 11 9
      src/drivers/cpu/driver_cpu.c
  3. 1 5
      src/drivers/cpu/driver_cpu.h

+ 0 - 2
src/Makefile.am

@@ -323,9 +323,7 @@ if STARPU_HAVE_HDF5
 libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES += core/disk_ops/disk_hdf5.c
 endif
 
-if STARPU_USE_CPU
 libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES += drivers/cpu/driver_cpu.c
-endif
 
 if STARPU_USE_CUDA
 libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES += drivers/cuda/driver_cuda.c

+ 11 - 9
src/drivers/cpu/driver_cpu.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011,2012,2014-2017                      Inria
- * Copyright (C) 2008-2018                                Université de Bordeaux
+ * Copyright (C) 2008-2019                                Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2017,2019                           CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
@@ -55,6 +55,7 @@
 #endif
 
 
+#ifdef STARPU_USE_CPU
 /* Actually launch the job on a cpu worker.
  * Handle binding CPUs on cores.
  * In the case of a combined worker WORKER_TASK != J->TASK */
@@ -429,6 +430,15 @@ int _starpu_cpu_driver_run(struct _starpu_worker *worker)
 	return 0;
 }
 
+struct _starpu_driver_ops _starpu_driver_cpu_ops =
+{
+	.init = _starpu_cpu_driver_init,
+	.run = _starpu_cpu_driver_run,
+	.run_once = _starpu_cpu_driver_run_once,
+	.deinit = _starpu_cpu_driver_deinit
+};
+#endif /* STARPU_USE_CPU */
+
 int _starpu_cpu_copy_data(starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req)
 {
 	int src_kind = starpu_node_get_kind(src_node);
@@ -491,11 +501,3 @@ void _starpu_cpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size, in
 #endif
 				   );
 }
-
-struct _starpu_driver_ops _starpu_driver_cpu_ops =
-{
-	.init = _starpu_cpu_driver_init,
-	.run = _starpu_cpu_driver_run,
-	.run_once = _starpu_cpu_driver_run_once,
-	.deinit = _starpu_cpu_driver_deinit
-};

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

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2014                                Inria
- * Copyright (C) 2008-2011,2014,2018                      Université de Bordeaux
+ * Copyright (C) 2008-2011,2014,2018-2019                 Université de Bordeaux
  * Copyright (C) 2010,2012,2013,2015,2017,2019            CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -21,8 +21,6 @@
 
 #include <common/config.h>
 
-#ifdef STARPU_USE_CPU
-
 extern struct _starpu_driver_ops _starpu_driver_cpu_ops;
 void *_starpu_cpu_worker(void *);
 
@@ -33,6 +31,4 @@ int _starpu_cpu_direct_access_supported(unsigned node, unsigned handling_node);
 uintptr_t _starpu_cpu_malloc_on_node(unsigned dst_node, size_t size, int flags);
 void _starpu_cpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size, int flags);
 
-#endif /* !STARPU_USE_CPU */
-
 #endif //  __DRIVER_CPU_H__