From 8aac2c5df7e343ca1f43f7c2cf0366af02a0f49c Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Mon, 12 Jun 2017 17:08:24 +0800 Subject: Add clFinish for guarantee the kernel copying is finished when create TILE_Y large image. Signed-off-by: Yan Wang Reviewed-by: Yang Rong --- src/cl_mem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cl_mem.c b/src/cl_mem.c index 3f41fd80..b6dce3f3 100644 --- a/src/cl_mem.c +++ b/src/cl_mem.c @@ -817,6 +817,13 @@ _cl_new_image_copy_from_host_ptr(cl_context ctx, return NULL; } + err = clFinish(ctx->image_queue); + if(err != CL_SUCCESS) { + clReleaseMemObject(buf); + clReleaseMemObject(mem); + return NULL; + } + clReleaseMemObject(buf); if (flags & CL_MEM_USE_HOST_PTR && data) { mem->host_ptr = data; -- cgit v1.2.3