[Beignet] [PATCH V2] Fix a clEnqueueBarrierWithWaitList event status bug.
Yichao Yu
yyc1992 at gmail.com
Mon Jun 16 07:08:45 PDT 2014
I can confirm that v2 fixes my problem with
clEnqueueBarrierWithWaitList[1] (and v1 doesn't compile ;P)
THX.
[1] https://gist.github.com/yuyichao/8b661d51c81f1c85466e
On Mon, Jun 16, 2014 at 4:20 AM, Yang Rong <rong.r.yang at intel.com> wrote:
> Event's status should be CL_COMPLETE if all wait events are complete in the wait list, in function
> clEnqueueBarrierWithWaitList and clEnqueueMarkerWithWaitList.
>
> v2: revert delete the event change in v1.
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
> src/cl_event.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/src/cl_event.c b/src/cl_event.c
> index 5dccfd9..c93d245 100644
> --- a/src/cl_event.c
> +++ b/src/cl_event.c
> @@ -484,9 +484,11 @@ cl_int cl_event_marker_with_wait_list(cl_command_queue queue,
> //enqueues a marker command which waits for either a list of events to complete, or if the list is
> //empty it waits for all commands previously enqueued in command_queue to complete before it completes.
> if(num_events_in_wait_list > 0){
> - data.type = EnqueueMarker;
> - cl_event_new_enqueue_callback(*event, &data, num_events_in_wait_list, event_wait_list);
> - return CL_SUCCESS;
> + if(cl_event_wait_events(num_events_in_wait_list, event_wait_list, queue) == CL_ENQUEUE_EXECUTE_DEFER) {
> + data.type = EnqueueMarker;
> + cl_event_new_enqueue_callback(*event, &data, num_events_in_wait_list, event_wait_list);
> + return CL_SUCCESS;
> + }
> } else if(queue->wait_events_num > 0) {
> data.type = EnqueueMarker;
> cl_event_new_enqueue_callback(*event, &data, queue->wait_events_num, queue->wait_events);
> @@ -519,9 +521,11 @@ cl_int cl_event_barrier_with_wait_list(cl_command_queue queue,
> //enqueues a barrier command which waits for either a list of events to complete, or if the list is
> //empty it waits for all commands previously enqueued in command_queue to complete before it completes.
> if(num_events_in_wait_list > 0){
> - data.type = EnqueueBarrier;
> - cl_event_new_enqueue_callback(e, &data, num_events_in_wait_list, event_wait_list);
> - return CL_SUCCESS;
> + if(cl_event_wait_events(num_events_in_wait_list, event_wait_list, queue) == CL_ENQUEUE_EXECUTE_DEFER) {
> + data.type = EnqueueBarrier;
> + cl_event_new_enqueue_callback(e, &data, num_events_in_wait_list, event_wait_list);
> + return CL_SUCCESS;
> + }
> } else if(queue->wait_events_num > 0) {
> data.type = EnqueueBarrier;
> cl_event_new_enqueue_callback(e, &data, queue->wait_events_num, queue->wait_events);
> --
> 1.9.1
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list