summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo <xionghu.luo@intel.com>2014-06-17 10:59:05 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-17 17:15:16 +0800
commit853ac4d94de25cf2c29fb8225e2a7162f40bdc7d (patch)
tree3d6a5702be76719a1da683a7f09b63a44fe5218a
parent473f19bfb1134293c3f827c97cd39cabe82ae1fc (diff)
fix clEnqueueMarkerWithWaitList bug when input event is null.
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/cl_api.c5
-rw-r--r--src/cl_event.c11
2 files changed, 9 insertions, 7 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index 73447c4f..327f02bd 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -2973,10 +2973,7 @@ clEnqueueMarkerWithWaitList(cl_command_queue command_queue,
{
cl_int err = CL_SUCCESS;
CHECK_QUEUE(command_queue);
- if(event == NULL) {
- err = CL_INVALID_VALUE;
- goto error;
- }
+
TRY(cl_event_check_waitlist, num_events_in_wait_list, event_wait_list, event, command_queue->ctx);
cl_event_marker_with_wait_list(command_queue, num_events_in_wait_list, event_wait_list, event);
diff --git a/src/cl_event.c b/src/cl_event.c
index c93d2456..76d67606 100644
--- a/src/cl_event.c
+++ b/src/cl_event.c
@@ -476,11 +476,16 @@ cl_int cl_event_marker_with_wait_list(cl_command_queue queue,
cl_event* event)
{
enqueue_data data = { 0 };
+ cl_event e;
- *event = cl_event_new(queue->ctx, queue, CL_COMMAND_MARKER, CL_TRUE);
- if(event == NULL)
+ e = cl_event_new(queue->ctx, queue, CL_COMMAND_MARKER, CL_TRUE);
+ if(e == NULL)
return CL_OUT_OF_HOST_MEMORY;
+ if(event != NULL ){
+ *event = e;
+ }
+
//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){
@@ -499,7 +504,7 @@ cl_int cl_event_marker_with_wait_list(cl_command_queue queue,
cl_gpgpu_event_update_status(queue->last_event->gpgpu_event, 1);
}
- cl_event_set_status(*event, CL_COMPLETE);
+ cl_event_set_status(e, CL_COMPLETE);
return CL_SUCCESS;
}