[Beignet] [PATCH] Runtime: Fix null device for clGetKernelWorkGroupInfo

Yang, Rong R rong.r.yang at intel.com
Wed Aug 31 08:06:34 UTC 2016


LGTM, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Xiuli Pan
> Sent: Friday, August 19, 2016 17:46
> To: beignet at lists.freedesktop.org
> Cc: Pan, Xiuli <xiuli.pan at intel.com>
> Subject: [Beignet] [PATCH] Runtime: Fix null device for
> clGetKernelWorkGroupInfo
> 
> From: Pan Xiuli <xiuli.pan at intel.com>
> 
> The device arg for API clGetKernelWorkGroupInfo can be NULL.
> 
> Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
> ---
>  src/cl_device_id.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/cl_device_id.c b/src/cl_device_id.c index d29138d..08cc0c0
> 100644
> --- a/src/cl_device_id.c
> +++ b/src/cl_device_id.c
> @@ -1157,6 +1157,8 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,  {
>    int err = CL_SUCCESS;
>    int dimension = 0;
> +  if (device == NULL)
> +    device = kernel->program->ctx->device;
>    if (UNLIKELY(is_gen_device(device) == CL_FALSE))
>      return CL_INVALID_DEVICE;
> 
> --
> 2.7.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list