[Beignet] [PATCH] release previous kernel in cl_kernel_init
Homer Hsing
homer.xing at intel.com
Mon Nov 4 00:29:02 PST 2013
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
More information about the Beignet
mailing list