summaryrefslogtreecommitdiff
path: root/src/cl_command_queue_enqueue.c
diff options
context:
space:
mode:
authorRebecca N. Palmer <rebecca_palmer@zoho.com>2018-07-21 20:12:48 +0100
committerYang Rong <rong.r.yang@intel.com>2018-08-20 15:32:16 +0800
commitab45f14f1e552a5d8b300b2bf5b7bdbed525110c (patch)
tree2dbd62d56f96a89a4ab696cd0b4ac6966574b98e /src/cl_command_queue_enqueue.c
parente1b2419a0008e38ef2d9d255d9e9c74e9fba084b (diff)
downloadbeignet-ab45f14f1e552a5d8b300b2bf5b7bdbed525110c.tar.gz
Make in-order command queues actually be in-order
When beignet added out-of-order execution support (7fd45f15), it made *all* command queues out-of-order, even if they were created as (and are reported by clGetCommandQueueInfo as) in-order. Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_command_queue_enqueue.c')
-rw-r--r--src/cl_command_queue_enqueue.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/cl_command_queue_enqueue.c b/src/cl_command_queue_enqueue.c
index 44a07615..8166d82b 100644
--- a/src/cl_command_queue_enqueue.c
+++ b/src/cl_command_queue_enqueue.c
@@ -65,6 +65,8 @@ worker_thread_function(void *Arg)
if (cl_event_is_ready(e) <= CL_COMPLETE) {
list_node_del(&e->enqueue_node);
list_add_tail(&ready_list, &e->enqueue_node);
+ } else if(!(queue->props & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE)){
+ break; /* in in-order mode, can't skip over non-ready events */
}
}
@@ -80,18 +82,20 @@ worker_thread_function(void *Arg)
CL_OBJECT_UNLOCK(queue);
/* Do the really job without lock.*/
- exec_status = CL_SUBMITTED;
- list_for_each_safe(pos, n, &ready_list)
- {
- e = list_entry(pos, _cl_event, enqueue_node);
- cl_event_exec(e, exec_status, CL_FALSE);
- }
+ if (queue->props & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) { /* in in-order mode, need to get each all the way to CL_COMPLETE before starting the next one */
+ exec_status = CL_SUBMITTED;
+ list_for_each_safe(pos, n, &ready_list)
+ {
+ e = list_entry(pos, _cl_event, enqueue_node);
+ cl_event_exec(e, exec_status, CL_FALSE);
+ }
- /* Notify all waiting for flush. */
- CL_OBJECT_LOCK(queue);
- worker->in_exec_status = CL_SUBMITTED;
- CL_OBJECT_NOTIFY_COND(queue);
- CL_OBJECT_UNLOCK(queue);
+ /* Notify all waiting for flush. */
+ CL_OBJECT_LOCK(queue);
+ worker->in_exec_status = CL_SUBMITTED;
+ CL_OBJECT_NOTIFY_COND(queue);
+ CL_OBJECT_UNLOCK(queue);
+ }
list_for_each_safe(pos, n, &ready_list)
{