[Beignet] [PATCH] Runtime: Use cl_ulong as CL_DEVICE_MAX_MEM_ALLOC_SIZE's return type.

Simon Richter Simon.Richter at hogyros.de
Thu Dec 8 12:35:37 UTC 2016


Hi,

On Thu, Dec 08, 2016 at 03:47:28PM +0800, Yang Rong wrote:

> diff --git a/src/cl_device_id.c b/src/cl_device_id.c
> index 24334fd..71a7be1 100644
> --- a/src/cl_device_id.c
> +++ b/src/cl_device_id.c
> @@ -926,6 +926,7 @@ cl_get_device_ids(cl_platform_id    platform,
>      }                                                               \
>      if (param_value_size < sizeof device->FIELD)                    \
>        return CL_INVALID_VALUE;                                      \
> +    memset(param_value, 0, param_value_size);                       \
>      memcpy(param_value, &device->FIELD, sizeof device->FIELD);      \
>      return CL_SUCCESS;
>  

I don't see the point -- programs are not supposed to behave differently
here, and it might hide errors when running under valgrind. I don't have
any strong feelings on this though.

The rest of the patch looks good to me.

   Simon


More information about the Beignet mailing list