[Beignet] [PATCH] fix switch bug and utest memory leak.

xionghu.luo at intel.com xionghu.luo at intel.com
Tue Sep 16 14:58:17 PDT 2014


From: Luo Xionghu <xionghu.luo at intel.com>

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 src/cl_device_id.c                        |    1 +
 utests/builtin_kernel_max_global_size.cpp |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index ee3f2b7..1ce5380 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -607,6 +607,7 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,
 
         return CL_SUCCESS;
       }
+      return CL_SUCCESS;
     default:
       return CL_INVALID_VALUE;
   };
diff --git a/utests/builtin_kernel_max_global_size.cpp b/utests/builtin_kernel_max_global_size.cpp
index c777564..e6910cd 100644
--- a/utests/builtin_kernel_max_global_size.cpp
+++ b/utests/builtin_kernel_max_global_size.cpp
@@ -18,12 +18,13 @@ void builtin_kernel_max_global_size(void)
   OCL_ASSERT(builtin_kernel_1d != NULL);
   size_t param_value_size;
   void* param_value;
-  clGetKernelWorkGroupInfo(builtin_kernel_1d, device, CL_KERNEL_GLOBAL_WORK_SIZE, 0, NULL, &param_value_size);
+  OCL_CALL(clGetKernelWorkGroupInfo, builtin_kernel_1d, device, CL_KERNEL_GLOBAL_WORK_SIZE, 0, NULL, &param_value_size);
   param_value = malloc(param_value_size);
-  clGetKernelWorkGroupInfo(builtin_kernel_1d, device, CL_KERNEL_GLOBAL_WORK_SIZE, param_value_size, param_value, 0);
+  OCL_CALL(clGetKernelWorkGroupInfo, builtin_kernel_1d, device, CL_KERNEL_GLOBAL_WORK_SIZE, param_value_size, param_value, 0);
   OCL_ASSERT(*(size_t*)param_value == 256 * 1024 *1024);
   clReleaseKernel(builtin_kernel_1d);
   clReleaseProgram(built_in_prog);
+  free(built_in_kernel_names);
   free(param_value);
 }
 
-- 
1.7.9.5



More information about the Beignet mailing list