[Beignet] [PATCH V2] fix the condition to check if there are built-in kernels
Yang, Rong R
rong.r.yang at intel.com
Wed Aug 31 07:53:10 UTC 2016
Will use this version, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Guo Yejun
> Sent: Monday, August 22, 2016 2:58
> To: beignet at lists.freedesktop.org
> Cc: Guo, Yejun <yejun.guo at intel.com>
> Subject: [Beignet] [PATCH V2] 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.
>
> v2: output "Skip!" to make the result clear
> Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> ---
> utests/builtin_kernel_max_global_size.cpp | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/utests/builtin_kernel_max_global_size.cpp
> b/utests/builtin_kernel_max_global_size.cpp
> index d3e8373..ad9c028 100644
> --- a/utests/builtin_kernel_max_global_size.cpp
> +++ b/utests/builtin_kernel_max_global_size.cpp
> @@ -10,8 +10,10 @@ 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
> + printf(" no built in kernel, Skip!");
> return;
> + }
>
> built_in_kernel_names = (char* )malloc(built_in_kernels_size *
> sizeof(char) );
> OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_BUILT_IN_KERNELS,
> built_in_kernels_size, (void*)built_in_kernel_names, &ret_sz);
> --
> 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