[Mesa-dev] [RFC PATCH] clover: add LLVM version to device and platform version

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Thu May 12 19:53:52 UTC 2016


Code generation (kernel compilation) may sometimes hit LLVM-specific
bugs. Adding the used LLVM version to the version string may make bug
triaging easier.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
---
 configure.ac                                       | 2 +-
 src/gallium/state_trackers/clover/api/device.cpp   | 2 +-
 src/gallium/state_trackers/clover/api/platform.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


I believe similar additions could be made for OpenGL version strings as well.

diff --git a/configure.ac b/configure.ac
index 023110e..4fcadcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2116,7 +2116,7 @@ if test "x$enable_gallium_llvm" = xyes; then
             LLVM_COMPONENTS="${LLVM_COMPONENTS} all-targets ipo linker instrumentation"
             LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader option objcarcopts profiledata"
         fi
-        DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
+        DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH '-DMESA_LLVM_VERSION_STRING=\"$LLVM_VERSION_MAJOR.$LLVM_VERSION_MINOR.$LLVM_VERSION_PATCH\"'"
         MESA_LLVM=1
 
         dnl Check for Clang internal headers
diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index bc93f91..0d0f77b 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -300,7 +300,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_VERSION:
-      buf.as_string() = "OpenCL 1.1 MESA " PACKAGE_VERSION;
+      buf.as_string() = "OpenCL 1.1 MESA " PACKAGE_VERSION " LLVM " MESA_LLVM_VERSION_STRING;
       break;
 
    case CL_DEVICE_EXTENSIONS:
diff --git a/src/gallium/state_trackers/clover/api/platform.cpp b/src/gallium/state_trackers/clover/api/platform.cpp
index cf71593..06eb4ec 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -57,7 +57,7 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
       break;
 
    case CL_PLATFORM_VERSION:
-      buf.as_string() = "OpenCL 1.1 MESA " PACKAGE_VERSION;
+      buf.as_string() = "OpenCL 1.1 MESA " PACKAGE_VERSION " LLVM " MESA_LLVM_VERSION_STRING;
       break;
 
    case CL_PLATFORM_NAME:
-- 
2.8.1.372.g9612035



More information about the mesa-dev mailing list