[Piglit] [PATCH 2/2] cl: Wait for kernel execution instead of flushing the queue in cl_piglit_execute kernel

Jan Vesely jan.vesely at rutgers.edu
Thu Nov 22 04:36:18 UTC 2018


From: Jan Vesely <jano.vesely at gmail.com>

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 <jano.vesely at gmail.com>
---
 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 f4def259cc..42a5e72f92 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",
-- 
2.18.1



More information about the Piglit mailing list