CL: Refine the version string handling.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Mon, 8 Jul 2013 09:36:45 +0000 (17:36 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Fri, 12 Jul 2013 01:42:37 +0000 (09:42 +0800)
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@linux.intel.com>
Reviewed-by: Song, Ruiling <ruiling.song@intel.com>
CMakeLists.txt
src/OCLConfig.h.in
src/cl_gt_device.h
src/cl_mem_gl.c
src/cl_platform_id.c
src/cl_platform_id.h

index 41ac43b..11b1794 100644 (file)
@@ -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"
index cfd0378..8662584 100644 (file)
@@ -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@
index 8fe863a..f58e1fd 100644 (file)
     .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
 
 
index 04641a5..f247171 100644 (file)
@@ -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]);
 }
 
index 2e0a86a..33915ce 100644 (file)
@@ -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")
index 5701a50..b8f7d61 100644 (file)
@@ -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__ */