[Beignet] [PATCH] Add clGetKernelSubGroupInfoKHR to _cl_icd_dispatch table

Yang, Rong R rong.r.yang at intel.com
Mon Oct 10 13:38:32 UTC 2016


This patch causes a warning:
/home/yr /beignet/src/cl_khr_icd.c:187:3: warning: initialization from incompatible pointer type
   clGetKernelSubGroupInfoKHR,

/home/yr/maintain/beignet/src/cl_khr_icd.c:187:3: warning: (near initialization for ‘cl_khr_icd_dispatch.clUnknown136’)

I checked the 2.2.8's ocl_icd.h:

#ifdef CL_VERSION_2_0
  CL_API_ENTRY cl_int (CL_API_CALL*clGetKernelSubGroupInfoKHR)(
    cl_kernel /* in_kernel */,
    cl_device_id /*in_device*/,
    cl_kernel_sub_group_info /* param_name */,
    size_t /*input_value_size*/,
    const void * /*input_value*/,
    size_t /*param_value_size*/,
    void* /*param_value*/,
    size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
#else
  CL_API_ENTRY cl_int (CL_API_CALL* clUnknown136)(void);
#endif

clGetKernelSubGroupInfoKHR is available from OpenCL2.0, also need OpenCL version check in beignet?

BTW: ocl-icd 2.2.8's OCL_ICD_IDENTIFIED_FUNCTIONS is 128, is it a typo?
> +#if (OCL_ICD_IDENTIFIED_FUNCTIONS > 110)

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Rebecca N. Palmer
> Sent: Saturday, October 8, 2016 21:11
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] Add clGetKernelSubGroupInfoKHR to
> _cl_icd_dispatch table
> 
> ocl-icd >= 2.2.8 has this function in its table; as the lookup process tries the
> dispatch table before the ICD's clGetExtensionFunctionAddress, requesting a
> function that is in the ICD loader's table but off the end of the ICD's table will
> return a garbage pointer.
> 
> Signed-off-by: Rebecca N. Palmer <rebecca_palmer at zoho.com>
> ---
>  src/cl_khr_icd.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c index 8715bbd..2cf4909 100644
> --- a/src/cl_khr_icd.c
> +++ b/src/cl_khr_icd.c
> @@ -17,7 +17,7 @@
>  #include <ocl_icd.h>
> 
>  #include "cl_platform_id.h"
> -
> +#include "CL/cl_intel.h" // for clGetKernelSubGroupInfoKHR
>  /* The interop functions are not implemented in Beignet */  #define
> CL_GL_INTEROP(x) NULL
>  /* OpenCL 1.2 is not implemented in Beignet */ @@ -168,7 +168,24 @@
> struct _cl_icd_dispatch const cl_khr_icd_dispatch = {
>    (void *) NULL,
>    (void *) NULL,
>    (void *) NULL,
> -  (void *) NULL
> +  (void *) NULL,
> +#if (OCL_ICD_IDENTIFIED_FUNCTIONS > 110)
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  (void *) NULL,
> +  clGetKernelSubGroupInfoKHR,
> +#endif
>  #endif
>  };
> 
> --
> 2.1.4
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list