diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2014-07-03 11:33:10 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-07-03 14:49:57 +0800 |
commit | 68cec04a5b9b44bf636b3eb0342cc2fac596814b (patch) | |
tree | 3e3ed9e1e37fa01aa19e227a2d097ba68c21af5d /src/cl_command_queue.h | |
parent | 809df2b3b59328c780fe8107edf6c8da07f460fc (diff) |
runtime: fix a gpgpu event and thread local gpgpu handling bug.
When pending a command queue, we need to record the whole gpgpu
structure not just the batch buffer. For the following reason:
1. We need to keep those private buffer, for example those printf buffers.
2. We need to make sure this gpgpu will not be reused by other enqueuement.
v2:
Don't try to flush all user event attached to the queue.
Just need to flush the current event when doing command queue flush.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_command_queue.h')
-rw-r--r-- | src/cl_command_queue.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cl_command_queue.h b/src/cl_command_queue.h index b79d63ad..bd70f255 100644 --- a/src/cl_command_queue.h +++ b/src/cl_command_queue.h @@ -41,6 +41,7 @@ struct _cl_command_queue { cl_int wait_events_num; /* Number of Non-complete user events */ cl_int wait_events_size; /* The size of array that wait_events point to */ cl_event last_event; /* The last event in the queue, for enqueue mark used */ + cl_event current_event; /* Current event. */ cl_command_queue_properties props; /* Queue properties */ cl_command_queue prev, next; /* We chain the command queues together */ void *thread_data; /* Used to store thread context data */ @@ -82,6 +83,9 @@ cl_int cl_command_queue_set_fulsim_buffer(cl_command_queue, cl_mem); /* Flush for the command queue */ extern cl_int cl_command_queue_flush(cl_command_queue); +/* Flush for the specified gpgpu */ +extern void cl_command_queue_flush_gpgpu(cl_command_queue, cl_gpgpu); + /* Wait for the completion of the command queue */ extern cl_int cl_command_queue_finish(cl_command_queue); |