Преглед на файлове

SOCL: implement clEnqueue{Barrier,Marker}WithWaitList

Sylvain Henry преди 12 години
родител
ревизия
9f93007cb0
променени са 5 файла, в които са добавени 90 реда и са изтрити 3 реда
  1. 2 0
      socl/src/Makefile.am
  2. 34 0
      socl/src/cl_enqueuebarrierwithwaitlist.c
  3. 37 0
      socl/src/cl_enqueuemarkerwithwaitlist.c
  4. 3 3
      socl/src/socl.c
  5. 14 0
      socl/src/socl.h

+ 2 - 0
socl/src/Makefile.am

@@ -126,6 +126,8 @@ libsocl_@STARPU_EFFECTIVE_VERSION@_la_SOURCES = 						\
   cl_enqueuetask.c \
   cl_enqueuendrangekernel.c \
   cl_enqueuenativekernel.c \
+  cl_enqueuemarkerwithwaitlist.c \
+  cl_enqueuebarrierwithwaitlist.c \
   cl_geteventprofilinginfo.c \
   cl_getextensionfunctionaddress.c \
   cl_icdgetplatformidskhr.c

+ 34 - 0
socl/src/cl_enqueuebarrierwithwaitlist.c

@@ -0,0 +1,34 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2010,2013 University of Bordeaux
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include "socl.h"
+
+CL_API_ENTRY cl_int CL_API_CALL
+soclEnqueueBarrierWithWaitList(cl_command_queue  cq,
+                cl_uint num_events,
+                const cl_event * events,
+                cl_event *          event) CL_API_SUFFIX__VERSION_1_2
+{
+	command_barrier cmd = command_barrier_create();
+
+   cl_event ev = command_event_get(cmd);
+
+	command_queue_enqueue(cq, cmd, num_events, events);
+
+	RETURN_EVENT(ev, event);
+
+	return CL_SUCCESS;
+}

+ 37 - 0
socl/src/cl_enqueuemarkerwithwaitlist.c

@@ -0,0 +1,37 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2010,2013 University of Bordeaux
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include "socl.h"
+
+CL_API_ENTRY cl_int CL_API_CALL
+soclEnqueueMarkerWithWaitList(cl_command_queue  cq,
+                cl_uint num_events,
+                const cl_event * events,
+                cl_event *          event) CL_API_SUFFIX__VERSION_1_2
+{
+	if (events == NULL)
+		return soclEnqueueBarrierWithWaitList(cq, num_events, events, event);
+	
+	command_marker cmd = command_marker_create();
+
+   cl_event ev = command_event_get(cmd);
+
+	command_queue_enqueue(cq, cmd, num_events, events);
+
+	RETURN_EVENT(ev, event);
+
+	return CL_SUCCESS;
+}

+ 3 - 3
socl/src/socl.c

@@ -124,9 +124,9 @@ struct _cl_icd_dispatch socl_master_dispatch = {
   (void *) NULL, //  clEnqueueFillBuffer,
   (void *) NULL, //  clEnqueueFillImage,
   (void *) NULL, //  clEnqueueMigrateMemObjects,
-  (void *) NULL, //  clEnqueueMarkerWithWaitList,
-  (void *) NULL, //  clEnqueueBarrierWithWaitList,
-  (void *) soclGetExtensionFunctionAddressForPlatform, //  clGetExtensionFunctionAddressForPlatform,
+  soclEnqueueMarkerWithWaitList, //  clEnqueueMarkerWithWaitList,
+  soclEnqueueBarrierWithWaitList, //  clEnqueueBarrierWithWaitList,
+  soclGetExtensionFunctionAddressForPlatform, //  clGetExtensionFunctionAddressForPlatform,
   (void *) NULL, //  clCreateFromGLTexture,
   (void *) NULL,
   (void *) NULL,

+ 14 - 0
socl/src/socl.h

@@ -741,6 +741,20 @@ soclEnqueueWaitForEvents(cl_command_queue /* command_queue */,
 extern CL_API_ENTRY cl_int CL_API_CALL
 soclEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 
+extern CL_API_ENTRY cl_int soclEnqueueMarkerWithWaitList(
+    cl_command_queue /* command_queue */,
+    cl_uint           /* num_events_in_wait_list */,
+    const cl_event *  /* event_wait_list */,
+    cl_event *        /* event */
+  ) CL_API_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int soclEnqueueBarrierWithWaitList(
+    cl_command_queue /* command_queue */,
+    cl_uint           /* num_events_in_wait_list */,
+    const cl_event *  /* event_wait_list */,
+    cl_event *        /* event */
+  ) CL_API_SUFFIX__VERSION_1_2;
+
 /* Extension function access
  *
  * Returns the extension function address for the given function name,