[Beignet] [PATCH] fix the condition to check if there are built-in kernels
Yang, Rong R
rong.r.yang at intel.com
Wed Aug 31 06:57:04 UTC 2016
LGTM, will push it, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Guo Yejun
> Sent: Friday, August 19, 2016 7:37
> To: beignet at lists.freedesktop.org
> Cc: Guo, Yejun <yejun.guo at intel.com>
> Subject: [Beignet] [PATCH] fix the condition to check if there are built-in
> kernels
>
> an empty string is returned if no built-in kernels are supported by the device,
> and so the returned size is 1, not 0.
>
> Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> ---
> utests/builtin_kernel_max_global_size.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utests/builtin_kernel_max_global_size.cpp
> b/utests/builtin_kernel_max_global_size.cpp
> index d3e8373..7580572 100644
> --- a/utests/builtin_kernel_max_global_size.cpp
> +++ b/utests/builtin_kernel_max_global_size.cpp
> @@ -10,7 +10,7 @@ void builtin_kernel_max_global_size(void)
>
>
> OCL_CALL (clGetDeviceInfo, device, CL_DEVICE_BUILT_IN_KERNELS, 0, 0,
> &built_in_kernels_size);
> - if(built_in_kernels_size == 0)
> + if(built_in_kernels_size <= 1) //the size of empty string is 1
> return;
>
> built_in_kernel_names = (char* )malloc(built_in_kernels_size *
> sizeof(char) );
> --
> 1.9.1
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list