Nathalie Furmento лет назад: 13
Родитель
Сommit
08248b55d4
3 измененных файлов с 44 добавлено и 20 удалено
  1. 1 0
      ChangeLog
  2. 35 19
      configure.ac
  3. 8 1
      doc/chapters/configuration.texi

+ 1 - 0
ChangeLog

@@ -18,6 +18,7 @@ StarPU 1.0 (svn revision xxxx)
 ==============================================
 The extensions-again release
 
+  * Enable by default the SOCL extension.
   * Enable by default the GCC plug-in extension.
   * Add a field named magic to struct starpu_task which is set when
         initialising the task. starpu_task_submit will fail if the

+ 35 - 19
configure.ac

@@ -605,19 +605,26 @@ AC_ARG_WITH(opencl-lib-dir,
 		enable_opencl=yes
 	], [opencl_lib_dir=no])
 
-if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
-    	STARPU_CHECK_OPENCL($opencl_dir, $opencl_include_dir, $opencl_lib_dir)
-        if test "$have_valid_opencl" = "no" ; then
-            for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_INC_PATH/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
-                if test -n $f ; then
-    	            STARPU_CHECK_OPENCL($f, "no", "no")
-                    if test "$have_valid_opencl" = "yes" ; then
-                        break
-                    fi
-                fi
-            done
-        fi
+AC_DEFUN([STARPU_LOOK_FOR_OPENCL],
+[
+    	if test "x$has_opencl_being_checked" != "xyes" ; then
+    	    STARPU_CHECK_OPENCL($opencl_dir, $opencl_include_dir, $opencl_lib_dir)
+	    if test "$have_valid_opencl" = "no" ; then
+            	for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_INC_PATH/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
+		    if test -n $f ; then
+    			STARPU_CHECK_OPENCL($f, "no", "no")
+			if test "$have_valid_opencl" = "yes" ; then
+			    break
+			fi
+		    fi
+		done
+	    fi
+	    has_opencl_being_checked=yes
+	fi
+])
 
+if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
+	STARPU_LOOK_FOR_OPENCL()
 	# in case OpenCL was explicitely required, but is not available, this is an error
 	if test x$enable_opencl = xyes -a x$have_valid_opencl = xno; then
 	    AC_MSG_ERROR([cannot find OpenCL])
@@ -1176,16 +1183,25 @@ AC_ARG_ENABLE([socl],
   [AS_HELP_STRING([--enable-socl],
     [build the OpenCL interface (experimental)])],
   [enable_socl="$enableval"],
-  [enable_socl="no"])
+  [enable_socl="maybe"])
 
-if test "x$enable_socl" = "xyes"; then
-   #STARPU_SOCL_SUPPORT
-   build_socl="yes"
-else
-   build_socl="no"
-   run_socl_test_suite="no"
+AC_MSG_CHECKING(for SOCL)
+
+if test "x$enable_socl" = "xyes" -o "x$enable_socl" = "xmaybe" ; then
+    if test "$have_valid_opencl" = "no" ; then
+	STARPU_LOOK_FOR_OPENCL()
+    fi
+fi
+
+# in case SOCL was explicitely required, but is not available, this is an error
+if test "x$enable_socl" = "xyes" -a "$have_valid_opencl" = "no" ; then
+    AC_MSG_ERROR([SOCL cannot be enabled without OpenCL])
 fi
 
+# now we enable SOCL if and only if a proper setup is available
+build_socl=$have_valid_opencl
+
+AC_MSG_RESULT($build_socl)
 AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
 AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
 

+ 8 - 1
doc/chapters/configuration.texi

@@ -177,6 +177,7 @@ device. It is then available as the @code{STARPU_MAXIMPLEMENTATIONS} macro.
 * --with-mkl-cflags::           
 * --with-mkl-ldflags::          
 * --disable-gcc-extensions::    
+* --disable-socl::    
 @end menu
 
 @node --enable-perf-debug
@@ -256,11 +257,17 @@ Specify the linking flags for the MKL Library. Note that the
 website provides a script to determine the linking flags.
 
 @node --disable-gcc-extensions
-@subsubsection @code{--enable-gcc-extensions}
+@subsubsection @code{--disable-gcc-extensions}
 
 Disable the GCC plug-in. It is by default enabled if the GCC compiler
 provides a plug-in support.
 
+@node --disable-socl
+@subsubsection @code{--disable-socl}
+
+Disable the SOCL extension. It is by default enabled if a valid OpenCL
+installation is found.
+
 @node Execution configuration through environment variables
 @section Execution configuration through environment variables