Pārlūkot izejas kodu

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

Samuel Thibault 11 gadi atpakaļ
vecāks
revīzija
d0eab8ef8c
2 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  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
           ;;
    esac
+   save_LIBS="$LIBS"
+   LIBS="$LIBS $STARPU_OPENCL_LDFLAGS"
+   AC_CHECK_FUNCS([clEnqueueMarkerWithWaitList])
+   LIBS="$save_LIBS"
 fi
 
 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;
 		cl_command_queue 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]);
 #else
 		err = clEnqueueMarker(queue, &task_events[args->devid]);