[Beignet] [PATCH] fix the condition to check if there are built-in kernels

Guo Yejun yejun.guo at intel.com
Thu Aug 18 23:36:30 UTC 2016


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



More information about the Beignet mailing list