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

Zhigang Gong zhigang.gong at linux.intel.com
Tue Sep 16 19:53:57 PDT 2014


Please split this type of patch to two pathces next time. One is to fix the bug
in the libcl side, the other is to fix the utest.

I will do it for you this time. The patch LGTM, will push latter. Thanks.


On Wed, Sep 17, 2014 at 05:58:17AM +0800, xionghu.luo at intel.com wrote:
> 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
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list