[Beignet] [PATCH 1/2] CL: Refine the version string handling.

Song, Ruiling ruiling.song at intel.com
Thu Jul 11 18:30:50 PDT 2013


LGTM.
It is good. So we can refer the unified macro definition to know the version later.

-----Original Message-----
From: beignet-bounces+ruiling.song=intel.com at lists.freedesktop.org [mailto:beignet-bounces+ruiling.song=intel.com at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Friday, July 12, 2013 9:25 AM
To: beignet at lists.freedesktop.org
Subject: Re: [Beignet] [PATCH 1/2] CL: Refine the version string handling.

Ping for comments.
Thanks.

On Mon, Jul 08, 2013 at 05:36:45PM +0800, Zhigang Gong wrote:
> Now concentrate the version assignment at the root cmake files.
> All the other place will refer the specified macros other than hard 
> coded a number.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
> ---
>  CMakeLists.txt       |    6 ++++--
>  src/OCLConfig.h.in   |    6 ++++--
>  src/cl_gt_device.h   |    6 +++---
>  src/cl_mem_gl.c      |    2 +-
>  src/cl_platform_id.c |    2 +-
>  src/cl_platform_id.h |    8 +++-----
>  6 files changed, 16 insertions(+), 14 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt index 41ac43b..11b1794 
> 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -8,8 +8,10 @@
>  
>  CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
>  PROJECT(OCL)
> -set (LIBCL_VERSION_MAJOR 0)
> -set (LIBCL_VERSION_MINOR 2)
> +set (LIBCL_DRIVER_VERSION_MAJOR 0)
> +set (LIBCL_DRIVER_VERSION_MINOR 2)
> +set (LIBCL_C_VERSION_MAJOR 1)
> +set (LIBCL_C_VERSION_MINOR 1)
>  
>  configure_file (
>    "src/OCLConfig.h.in"
> diff --git a/src/OCLConfig.h.in b/src/OCLConfig.h.in index 
> cfd0378..8662584 100644
> --- a/src/OCLConfig.h.in
> +++ b/src/OCLConfig.h.in
> @@ -1,3 +1,5 @@
>  // the configured options and settings for LIBCL -#define 
> LIBCL_VERSION_MAJOR @LIBCL_VERSION_MAJOR@ -#define LIBCL_VERSION_MINOR 
> @LIBCL_VERSION_MINOR@
> +#define LIBCL_DRIVER_VERSION_MAJOR @LIBCL_DRIVER_VERSION_MAJOR@ 
> +#define LIBCL_DRIVER_VERSION_MINOR @LIBCL_DRIVER_VERSION_MINOR@ 
> +#define LIBCL_C_VERSION_MAJOR @LIBCL_C_VERSION_MAJOR@ #define 
> +LIBCL_C_VERSION_MINOR @LIBCL_C_VERSION_MINOR@
> diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h index 
> 8fe863a..f58e1fd 100644
> --- a/src/cl_gt_device.h
> +++ b/src/cl_gt_device.h
> @@ -68,12 +68,12 @@
>      .JOIN(FIELD,_sz) = sizeof(STRING) + 1,  DECL_INFO_STRING(name, 
> "Intel HD Graphics Family")  DECL_INFO_STRING(vendor, "Intel") 
> -DECL_INFO_STRING(version, OCL_VERSION_STRING)
> +DECL_INFO_STRING(version, LIBCL_VERSION_STRING)
>  DECL_INFO_STRING(profile, "FULL_PROFILE") 
> -DECL_INFO_STRING(opencl_c_version, "OpenCL C 1.1")
> +DECL_INFO_STRING(opencl_c_version, LIBCL_C_VERSION_STRING)
>  DECL_INFO_STRING(extensions, "")
>  DECL_INFO_STRING(built_in_kernels, "") 
> -DECL_INFO_STRING(driver_version, LIBCL_VERSION_STRING)
> +DECL_INFO_STRING(driver_version, LIBCL_DRIVER_VERSION_STRING)
>  #undef DECL_INFO_STRING
>  
>  
> diff --git a/src/cl_mem_gl.c b/src/cl_mem_gl.c index 04641a5..f247171 
> 100644
> --- a/src/cl_mem_gl.c
> +++ b/src/cl_mem_gl.c
> @@ -149,7 +149,7 @@ EGLImageKHR cl_create_textured_egl_image(cl_context ctx,
>    egl_context = (EGLDisplay)ctx->props.gl_context;
>    return egl_funcs->eglCreateImageKHR_func(egl_display, egl_context,
>                                             EGL_GL_TEXTURE_2D_KHR,
> -                                           (EGLClientBuffer)texture,
> +                                           
> + (EGLClientBuffer)(uintptr_t)texture,
>                                             &egl_attribs[0]);  }
>  
> diff --git a/src/cl_platform_id.c b/src/cl_platform_id.c index 
> 2e0a86a..33915ce 100644
> --- a/src/cl_platform_id.c
> +++ b/src/cl_platform_id.c
> @@ -33,7 +33,7 @@
>  static struct _cl_platform_id intel_platform_data = {
>    INIT_ICD(dispatch)
>    DECL_INFO_STRING(profile, "FULL_PROFILE")
> -  DECL_INFO_STRING(version, OCL_VERSION_STRING)
> +  DECL_INFO_STRING(version, LIBCL_VERSION_STRING)
>    DECL_INFO_STRING(name, "Experiment Intel Gen OCL Driver")
>    DECL_INFO_STRING(vendor, "Intel")
>    DECL_INFO_STRING(icd_suffix_khr, "Intel") diff --git 
> a/src/cl_platform_id.h b/src/cl_platform_id.h index 5701a50..b8f7d61 
> 100644
> --- a/src/cl_platform_id.h
> +++ b/src/cl_platform_id.h
> @@ -59,14 +59,12 @@ extern cl_int cl_get_platform_info(cl_platform_id    platform,
>                                     void *            param_value,
>                                     size_t *          param_value_size_ret);
>  
> -#define OCL_VERSION_MAJOR 1
> -#define OCL_VERSION_MINOR 1
> -
>  #define _STR(x) #x
>  #define _JOINT(x, y) _STR(x) "." _STR(y)
>  
> -#define OCL_VERSION_STRING "OpenCL " _JOINT(OCL_VERSION_MAJOR, 
> OCL_VERSION_MINOR) -#define LIBCL_VERSION_STRING 
> _JOINT(LIBCL_VERSION_MAJOR, LIBCL_VERSION_MINOR)
> +#define LIBCL_VERSION_STRING "OpenCL " _JOINT(LIBCL_C_VERSION_MAJOR, 
> +LIBCL_C_VERSION_MINOR) #define LIBCL_C_VERSION_STRING "OpenCL C " 
> +_JOINT(LIBCL_C_VERSION_MAJOR, LIBCL_C_VERSION_MINOR) #define 
> +LIBCL_DRIVER_VERSION_STRING _JOINT(LIBCL_DRIVER_VERSION_MAJOR, 
> +LIBCL_DRIVER_VERSION_MINOR)
>  
>  #endif /* __CL_PLATFORM_ID_H__ */
>  
> --
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list