summaryrefslogtreecommitdiff
path: root/src/cl_event.h
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-07-10 18:57:53 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-07-11 18:25:25 +0800
commit5bb03032ec59ffe8d2055107e2ffb96b97e40c55 (patch)
treed6739b97bd4bea8ef1590a6dcfc8723070aed265 /src/cl_event.h
parentcb8285a8be3dcb4aca7e896f2c45715f30f8aee6 (diff)
downloadbeignet-5bb03032ec59ffe8d2055107e2ffb96b97e40c55.tar.gz
runtime: fix some subtle event bugs.
This patch fix the following two bugs in event handling. 1. When it's time to call a event's user call back function, we need to set the executed to true before the call. As that call back function may call into clReleaseEvent(), and if we don't set the executed status to true, it will enter infinite recursive loop. 2. After the user call clEnqueueNDRangeKernel to get a valid event, the user set a call back function to that event, and in that call back function, it will release that event. This scenario is totally correct. But our current event handling doesn't have a deadicated timer thread to update those on-the-fly events' status. Thus those events will not have a chance to get updated, and those call back function will not executed forever. To introduce a complete timer style thread to maintain this type of events is too heavy for this fix release. This patch choose an easy way to work around it. It will make sure the last gpgpu event to be finished before current task to be enqueued. After this patch, most of the OpenCV 3.0 cases could run smoothly without any serious issue. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_event.h')
-rw-r--r--src/cl_event.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cl_event.h b/src/cl_event.h
index 3c23d742..cfe5ddd6 100644
--- a/src/cl_event.h
+++ b/src/cl_event.h
@@ -89,7 +89,7 @@ void cl_event_new_enqueue_callback(cl_event, enqueue_data *, cl_uint, const cl_e
/* Set the event status and call all callbacks */
void cl_event_set_status(cl_event, cl_int);
/* Check and update event status */
-void cl_event_update_status(cl_event);
+void cl_event_update_status(cl_event, cl_int);
/* Create the marker event */
cl_int cl_event_marker_with_wait_list(cl_command_queue, cl_uint, const cl_event *, cl_event*);
/* Create the barrier event */