diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2015-10-13 12:51:14 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-10-13 14:59:44 +0800 |
commit | 2d4973d7602e0b667a68d18a9bc360188686dc30 (patch) | |
tree | ffd3b31c9520b7de2fc470ecb9bf53724e310f62 /src/cl_event.h | |
parent | 192feb51bdb4b916f56c7310276ad0d3213bf8cd (diff) | |
download | beignet-2d4973d7602e0b667a68d18a9bc360188686dc30.tar.gz |
runtime: refine the last_event in queue to a list
Refine the event struct to make last_event become a list to store
all uncompeleted events and update them every queue flush. This can
make sure all events created in the runtime have a chance to update
status and run callback functions and then be deleted. We will also
fix the memory leak problem casued by uncompeted events.
This is a bugfix for https://bugs.freedesktop.org/show_bug.cgi?id=91710
The leaked events with gpu buffers will be unreferenced and cause other
drm buffer leak and result in terrible memory leak.
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_event.h')
-rw-r--r-- | src/cl_event.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cl_event.h b/src/cl_event.h index f7bf09f9..67fab190 100644 --- a/src/cl_event.h +++ b/src/cl_event.h @@ -71,6 +71,7 @@ struct _cl_event { cl_bool emplict; /* Identify this event whether created by api emplict*/ cl_ulong timestamp[4];/* The time stamps for profiling. */ cl_ulong queued_timestamp; + cl_event last_next, last_prev;/* We need a list to monitor untouchable api event*/ }; /* Create a new event object */ @@ -115,5 +116,9 @@ cl_int cl_event_insert_user_event(user_event** p_u_ev, cl_event event); cl_int cl_event_remove_user_event(user_event** p_u_ev, cl_event event); /* flush the event's pending gpgpu batch buffer and notify driver this gpgpu event has been flushed. */ cl_int cl_event_flush(cl_event event); +/* monitor or block wait all events in the last_event list */ +void cl_event_update_last_events(cl_command_queue queuet, int wait); +/* insert the event into the last_event list in queue */ +void cl_event_insert_last_events(cl_command_queue queue, cl_event event); #endif /* __CL_EVENT_H__ */ |