From 900a0bdf985d8e225c3d157d2c1ac635ae454b63 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Wed, 21 Nov 2018 23:21:08 -0500 Subject: cl: Wait for kernel execution instead of flushing the queue in cl_piglit_execute kernel This prevents race condition when a failed kernel launch would no longer be in the command queue by the time we call clFinish. Signed-off-by: Jan Vesely Tested-by: Maciej S. Szmigiero --- tests/util/piglit-util-cl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util-cl.c index f4def259c..42a5e72f9 100644 --- a/tests/util/piglit-util-cl.c +++ b/tests/util/piglit-util-cl.c @@ -1360,7 +1360,7 @@ piglit_cl_execute_ND_range_kernel(cl_command_queue command_queue, return false; } - errNo = clFinish(command_queue); + errNo = clWaitForEvents(1, &ev); if(!piglit_cl_check_error(errNo, CL_SUCCESS)) { fprintf(stderr, "Could not wait for kernel to finish: %s\n", -- cgit v1.2.3