瀏覽代碼

Asynchronous copies can also be disabled by configure options --disable-asynchronous-copy, --disable-asynchronous-cuda-copy and --disable-asynchronous-opencl-copy

Nathalie Furmento 13 年之前
父節點
當前提交
9c1d0e9fb6
共有 3 個文件被更改,包括 63 次插入1 次删除
  1. 45 1
      configure.ac
  2. 6 0
      doc/chapters/basic-api.texi
  3. 12 0
      src/core/workers.c

+ 45 - 1
configure.ac

@@ -241,7 +241,6 @@ AC_ARG_ENABLE(cpu, [AS_HELP_STRING([--disable-cpu],
 			enable_cpu=$enableval, enable_cpu=yes)
 AC_MSG_RESULT($enable_cpu)
 AC_SUBST(STARPU_USE_CPU, $enable_cpu)
-
 AM_CONDITIONAL(STARPU_USE_CPU, test x$enable_cpu = xyes)
 
 if test x$enable_cpu = xyes; then
@@ -703,6 +702,51 @@ fi
 
 ###############################################################################
 #                                                                             #
+# General GPU settings                                                        #
+#                                                                             #
+###############################################################################
+AC_MSG_CHECKING(whether asynchronous copy should be disabled)
+AC_ARG_ENABLE(asynchronous-copy, [AS_HELP_STRING([--disable-asynchronous-copy],
+			[disable asynchronous copy between CPU and GPU])],
+			enable_asynchronous_copy=$enableval, enable_asynchronous_copy=yes)
+disable_asynchronous_copy=no
+if test x$enable_asynchronous_copy = xno ; then
+   disable_asynchronous_copy=yes
+fi
+AC_MSG_RESULT($disable_asynchronous_copy)
+if test x$disable_asynchronous_copy = xyes ; then
+   AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and GPU devices])
+fi
+
+AC_MSG_CHECKING(whether asynchronous CUDA copy should be disabled)
+AC_ARG_ENABLE(asynchronous-cudacopy, [AS_HELP_STRING([--disable-asynchronous-cuda-copy],
+			[disable asynchronous copy between CPU and CUDA devices])],
+			enable_asynchronous_cuda_copy=$enableval, enable_asynchronous_cuda_copy=yes)
+disable_asynchronous_cuda_copy=no
+if test x$enable_asynchronous_cuda_copy = xno ; then
+   disable_asynchronous_cuda_copy=yes
+fi
+AC_MSG_RESULT($disable_asynchronous_cuda_copy)
+if test x$disable_asynchronous_cuda_copy = xyes ; then
+   AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_CUDA_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and CUDA devices])
+fi
+
+AC_MSG_CHECKING(whether asynchronous OpenCL copy should be disabled)
+AC_ARG_ENABLE(asynchronous-openclcopy, [AS_HELP_STRING([--disable-asynchronous-opencl-copy],
+			[disable asynchronous copy between CPU and OPENCL devices])],
+			enable_asynchronous_opencl_copy=$enableval, enable_asynchronous_opencl_copy=yes)
+disable_asynchronous_opencl_copy=no
+if test x$enable_asynchronous_opencl_copy = xno ; then
+   disable_asynchronous_opencl_copy=yes
+fi
+AC_MSG_RESULT($disable_asynchronous_opencl_copy)
+if test x$disable_asynchronous_opencl_copy = xyes ; then
+   AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and OpenCL devices])
+fi
+
+
+###############################################################################
+#                                                                             #
 #                                 Cell settings                               #
 #                                                                             #
 ###############################################################################

+ 6 - 0
doc/chapters/basic-api.texi

@@ -148,11 +148,15 @@ CPUs and all accelerators. This can also be specified with the
 The AMD implementation of OpenCL is known to
 fail when copying data asynchronously. When using this implementation,
 it is therefore necessary to disable asynchronous data transfers.
+This can also be specified at compilation time by giving to the
+configure script the option @code{--disable-asynchronous-copy}.
 
 @item @code{int disable_cuda_asynchronous_copy} (default = 0)
 This flag should be set to 1 to disable asynchronous copies between
 CPUs and CUDA accelerators. This can also be specified with the
 @code{STARPU_DISABLE_CUDA_ASYNCHRONOUS_COPY} environment variable.
+This can also be specified at compilation time by giving to the
+configure script the option @code{--disable-asynchronous-cuda-copy}.
 
 @item @code{int disable_opencl_asynchronous_copy} (default = 0)
 This flag should be set to 1 to disable asynchronous copies between
@@ -161,6 +165,8 @@ CPUs and OpenCL accelerators. This can also be specified with the
 The AMD implementation of OpenCL is known to
 fail when copying data asynchronously. When using this implementation,
 it is therefore necessary to disable asynchronous data transfers.
+This can also be specified at compilation time by giving to the
+configure script the option @code{--disable-asynchronous-opencl-copy}.
 
 @item @code{int *cuda_opengl_interoperability} (default = NULL)
 This can be set to an array of CUDA device identifiers for which

+ 12 - 0
src/core/workers.c

@@ -489,17 +489,29 @@ int starpu_conf_init(struct starpu_conf *conf)
 	if (conf->single_combined_worker == -1)
 	     conf->single_combined_worker = 0;
 
+#if defined(STARPU_DISABLE_ASYNCHRONOUS_COPY)
+	conf->disable_asynchronous_copy = 1;
+#else
 	conf->disable_asynchronous_copy = starpu_get_env_number("STARPU_DISABLE_ASYNCHRONOUS_COPY");
 	if (conf->disable_asynchronous_copy == -1)
 		conf->disable_asynchronous_copy = 0;
+#endif
 
+#if defined(STARPU_DISABLE_ASYNCHRONOUS_CUDA_COPY)
+	conf->disable_asynchronous_cuda_copy = 1;
+#else
 	conf->disable_cuda_asynchronous_copy = starpu_get_env_number("STARPU_DISABLE_CUDA_ASYNCHRONOUS_COPY");
 	if (conf->disable_cuda_asynchronous_copy == -1)
 		conf->disable_cuda_asynchronous_copy = 0;
+#endif
 
+#if defined(STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY)
+	conf->disable_asynchronous_opencl_copy = 1;
+#else
 	conf->disable_opencl_asynchronous_copy = starpu_get_env_number("STARPU_DISABLE_OPENCL_ASYNCHRONOUS_COPY");
 	if (conf->disable_opencl_asynchronous_copy == -1)
 		conf->disable_opencl_asynchronous_copy = 0;
+#endif
 
 	return 0;
 }