summaryrefslogtreecommitdiff
path: root/libclapi/cl_kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'libclapi/cl_kernel.c')
-rw-r--r--libclapi/cl_kernel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libclapi/cl_kernel.c b/libclapi/cl_kernel.c
index e4b2a0bd..1fc0f785 100644
--- a/libclapi/cl_kernel.c
+++ b/libclapi/cl_kernel.c
@@ -803,13 +803,13 @@ static cl_int cl_enqueue_ND_range(cl_command_queue queue, cl_kernel kernel, cons
if (event == NULL)
goto error;
}
- cl_enqueue_set_work_item_event(it, event);
+ if (event)
+ cl_enqueue_set_work_item_event(it, event);
if (it->status > CL_COMPLETE) { // Still something todo
err = cl_enqueue_insert_work_item(queue, it);
- if (err != CL_SUCCESS)
- goto error;
+ assert(err == CL_SUCCESS); // queue must be avaible.
} else {
cl_enqueue_destroy_work_item(queue, it);
}