[Beignet] [PATCH] release previous kernel in cl_kernel_init

Yang, Rong R rong.r.yang at intel.com
Wed Nov 6 00:19:00 PST 2013


LGTM.

-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Homer Hsing
Sent: Monday, November 04, 2013 4:29 PM
To: beignet at lists.freedesktop.org
Subject: [Beignet] [PATCH] release previous kernel in cl_kernel_init

Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 utests/utest_helper.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 207e30c..3e45e63 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");
--
1.8.3.2

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list