From: Homer Hsing Date: Mon, 4 Nov 2013 08:29:02 +0000 (+0800) Subject: release previous kernel in cl_kernel_init X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c128dcbb6593297394ad5a62b45a0a28f3dbb6b;p=contrib%2Fbeignet.git release previous kernel in cl_kernel_init Signed-off-by: Homer Hsing Reviewed-by: "Yang, Rong R" --- diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 8089799..e97f43f 100644 --- a/utests/utest_helper.cpp +++ b/utests/utest_helper.cpp @@ -263,6 +263,8 @@ cl_kernel_init(const char *file_name, const char *kernel_name, int format, const OCL_CALL (clBuildProgram, program, 1, &device, build_opt, NULL, NULL); /* Create a kernel from the program */ + if (kernel) + clReleaseKernel(kernel); kernel = clCreateKernel(program, kernel_name, &status); if (status != CL_SUCCESS) { fprintf(stderr, "error calling clCreateKernel\n");