Explorar el Código

Do not rely on the .h file for functions actually available at link time, do check them explicitly

Samuel Thibault hace 11 años
padre
commit
d0eab8ef8c
Se han modificado 2 ficheros con 5 adiciones y 1 borrados
  1. 4 0
      configure.ac
  2. 1 1
      src/drivers/opencl/driver_opencl.c

+ 4 - 0
configure.ac

@@ -853,6 +853,10 @@ if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
 	  enable_opencl=$have_valid_opencl
 	  enable_opencl=$have_valid_opencl
           ;;
           ;;
    esac
    esac
+   save_LIBS="$LIBS"
+   LIBS="$LIBS $STARPU_OPENCL_LDFLAGS"
+   AC_CHECK_FUNCS([clEnqueueMarkerWithWaitList])
+   LIBS="$save_LIBS"
 fi
 fi
 
 
 AC_MSG_CHECKING(whether OpenCL should be used)
 AC_MSG_CHECKING(whether OpenCL should be used)

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

@@ -685,7 +685,7 @@ int _starpu_opencl_driver_run_once(struct _starpu_worker *args)
 		int err;
 		int err;
 		cl_command_queue queue;
 		cl_command_queue queue;
 		starpu_opencl_get_queue(args->devid, &queue);
 		starpu_opencl_get_queue(args->devid, &queue);
-#ifdef CL_VERSION_1_2
+#ifdef HAVE_CLENQUEUEMARKERWITHWAITLIST
 		err = clEnqueueMarkerWithWaitList(queue, 0, NULL, &task_events[args->devid]);
 		err = clEnqueueMarkerWithWaitList(queue, 0, NULL, &task_events[args->devid]);
 #else
 #else
 		err = clEnqueueMarker(queue, &task_events[args->devid]);
 		err = clEnqueueMarker(queue, &task_events[args->devid]);