[Beignet] [PATCH] release previous program in cl_kernel_init

Homer Hsing homer.xing at intel.com
Mon Nov 4 21:08:15 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 3e45e63..fca71e4 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -239,6 +239,8 @@ cl_kernel_init(const char *file_name, const char *kernel_name, int format, const
   cl_int status = CL_SUCCESS;
 
   /* Load the program and build it */
+  if (program)
+    clReleaseProgram(program);
   ker_path = cl_do_kiss_path(file_name, device);
   if (format == LLVM)
     program = clCreateProgramWithLLVMIntel(ctx, 1, &device, ker_path, &status);
-- 
1.8.3.2



More information about the Beignet mailing list