summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorEdB <edb+mesa@sigluy.net>2014-04-26 19:11:09 +0200
committerFrancisco Jerez <currojerez@riseup.net>2014-04-29 13:12:38 +0200
commit5827781d25d2e27ebbcfc2362fcc14cc710bccf5 (patch)
tree07c3d1fb2f672cedbce01dc5cd4e6d3538b2869f /src/gallium/state_trackers
parent7b11c97d31ea9ebdf5d4b89e60bcc96d256aa7a4 (diff)
clover: Add clEnqueue{Marker, Barrier}WithWaitList.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/api/dispatch.cpp4
-rw-r--r--src/gallium/state_trackers/clover/api/event.cpp46
2 files changed, 43 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/clover/api/dispatch.cpp b/src/gallium/state_trackers/clover/api/dispatch.cpp
index 746372c0d64..e4f7ea3cc74 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.cpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.cpp
@@ -129,8 +129,8 @@ namespace clover {
NULL, // clEnqueueFillBuffer
NULL, // clEnqueueFillImage
NULL, // clEnqueueMigrateMemObjects
- NULL, // clEnqueueMarkerWithWaitList
- NULL, // clEnqueueBarrierWithWaitList
+ clEnqueueMarkerWithWaitList,
+ clEnqueueBarrierWithWaitList,
NULL, // clGetExtensionFunctionAddressForPlatform
NULL, // clCreateFromGLTexture
NULL, // clGetDeviceIDsFromD3D11KHR
diff --git a/src/gallium/state_trackers/clover/api/event.cpp b/src/gallium/state_trackers/clover/api/event.cpp
index 6b1956c8f2f..5d1a0e52c56 100644
--- a/src/gallium/state_trackers/clover/api/event.cpp
+++ b/src/gallium/state_trackers/clover/api/event.cpp
@@ -179,6 +179,29 @@ clEnqueueMarker(cl_command_queue d_q, cl_event *rd_ev) try {
}
CLOVER_API cl_int
+clEnqueueMarkerWithWaitList(cl_command_queue d_q, cl_uint num_deps,
+ const cl_event *d_deps, cl_event *rd_ev) try {
+ auto &q = obj(d_q);
+ auto deps = objs<wait_list_tag>(d_deps, num_deps);
+
+ for (auto &ev : deps) {
+ if (ev.context() != q.context())
+ throw error(CL_INVALID_CONTEXT);
+ }
+
+ // Create a hard event that depends on the events in the wait list:
+ // previous commands in the same queue are implicitly serialized
+ // with respect to it -- hard events always are.
+ auto hev = create<hard_event>(q, CL_COMMAND_MARKER, deps);
+
+ ret_object(rd_ev, hev);
+ return CL_SUCCESS;
+
+} catch (error &e) {
+ return e.get();
+}
+
+CLOVER_API cl_int
clEnqueueBarrier(cl_command_queue d_q) try {
obj(d_q);
@@ -191,12 +214,12 @@ clEnqueueBarrier(cl_command_queue d_q) try {
}
CLOVER_API cl_int
-clEnqueueWaitForEvents(cl_command_queue d_q, cl_uint num_evs,
- const cl_event *d_evs) try {
+clEnqueueBarrierWithWaitList(cl_command_queue d_q, cl_uint num_deps,
+ const cl_event *d_deps, cl_event *rd_ev) try {
auto &q = obj(d_q);
- auto evs = objs(d_evs, num_evs);
+ auto deps = objs<wait_list_tag>(d_deps, num_deps);
- for (auto &ev : evs) {
+ for (auto &ev : deps) {
if (ev.context() != q.context())
throw error(CL_INVALID_CONTEXT);
}
@@ -204,8 +227,9 @@ clEnqueueWaitForEvents(cl_command_queue d_q, cl_uint num_evs,
// Create a hard event that depends on the events in the wait list:
// subsequent commands in the same queue will be implicitly
// serialized with respect to it -- hard events always are.
- create<hard_event>(q, 0, evs);
+ auto hev = create<hard_event>(q, CL_COMMAND_BARRIER, deps);
+ ret_object(rd_ev, hev);
return CL_SUCCESS;
} catch (error &e) {
@@ -213,6 +237,18 @@ clEnqueueWaitForEvents(cl_command_queue d_q, cl_uint num_evs,
}
CLOVER_API cl_int
+clEnqueueWaitForEvents(cl_command_queue d_q, cl_uint num_evs,
+ const cl_event *d_evs) try {
+ // The wait list is mandatory for clEnqueueWaitForEvents().
+ objs(d_evs, num_evs);
+
+ return clEnqueueBarrierWithWaitList(d_q, num_evs, d_evs, NULL);
+
+} catch (error &e) {
+ return e.get();
+}
+
+CLOVER_API cl_int
clGetEventProfilingInfo(cl_event d_ev, cl_profiling_info param,
size_t size, void *r_buf, size_t *r_size) try {
property_buffer buf { r_buf, size, r_size };