ソースを参照

Enable cuda/opencl allocation in simgrid mode too

Samuel Thibault 6 年 前
コミット
4c4e01d091
共有3 個のファイルを変更した7 個の追加3 個の削除を含む
  1. 4 0
      src/datawizard/node_ops.c
  2. 2 1
      src/drivers/cuda/driver_cuda.c
  3. 1 2
      src/drivers/opencl/driver_opencl.c

+ 4 - 0
src/datawizard/node_ops.c

@@ -51,6 +51,8 @@ void _starpu_node_ops_init()
 	_node_ops[STARPU_CUDA_RAM].copy_interface_to[STARPU_CPU_RAM] = _starpu_cuda_copy_interface_from_cuda_to_cpu;
 	_node_ops[STARPU_CPU_RAM].copy_interface_to[STARPU_CUDA_RAM] = _starpu_cuda_copy_interface_from_cpu_to_cuda;
 	_node_ops[STARPU_CUDA_RAM].direct_access_supported = _starpu_cuda_direct_access_supported;
+#endif
+#if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
 	_node_ops[STARPU_CUDA_RAM].malloc_on_node = _starpu_cuda_malloc_on_node;
 	_node_ops[STARPU_CUDA_RAM].free_on_node = _starpu_cuda_free_on_node;
 #endif
@@ -65,6 +67,8 @@ void _starpu_node_ops_init()
 	_node_ops[STARPU_OPENCL_RAM].copy_interface_to[STARPU_CPU_RAM] = _starpu_opencl_copy_interface_from_opencl_to_cpu;
 	_node_ops[STARPU_CPU_RAM].copy_interface_to[STARPU_OPENCL_RAM] = _starpu_opencl_copy_interface_from_cpu_to_opencl;
 	_node_ops[STARPU_OPENCL_RAM].direct_access_supported = _starpu_opencl_direct_access_supported;
+#endif
+#if defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
 	_node_ops[STARPU_OPENCL_RAM].malloc_on_node = _starpu_opencl_malloc_on_node;
 	_node_ops[STARPU_OPENCL_RAM].free_on_node = _starpu_opencl_free_on_node;
 #endif

+ 2 - 1
src/drivers/cuda/driver_cuda.c

@@ -1453,6 +1453,8 @@ int _starpu_cuda_direct_access_supported(unsigned node, unsigned handling_node)
 #endif /* STARPU_HAVE_CUDA_MEMCPY_PEER */
 }
 
+#endif /* STARPU_USE_CUDA */
+
 uintptr_t _starpu_cuda_malloc_on_node(unsigned dst_node, size_t size, int flags)
 {
 	uintptr_t addr = 0;
@@ -1548,7 +1550,6 @@ void _starpu_cuda_free_on_node(unsigned dst_node, uintptr_t addr, size_t size, i
 #endif /* STARPU_SIMGRID */
 #endif
 }
-#endif
 
 struct _starpu_driver_ops _starpu_driver_cuda_ops =
 {

+ 1 - 2
src/drivers/opencl/driver_opencl.c

@@ -1287,6 +1287,7 @@ int _starpu_opencl_direct_access_supported(unsigned node, unsigned handling_node
 	(void)handling_node;
 	return 0;
 }
+#endif /* STARPU_USE_OPENCL */
 
 uintptr_t _starpu_opencl_malloc_on_node(unsigned dst_node, size_t size, int flags)
 {
@@ -1339,5 +1340,3 @@ void _starpu_opencl_free_on_node(unsigned dst_node, uintptr_t addr, size_t size,
 		STARPU_OPENCL_REPORT_ERROR(err);
 #endif
 }
-
-#endif /* STARPU_USE_OPENCL */