[Mesa-dev] [PATCH v2] clover: Update OpenCL version string to match OpenGL
Vedran Miletić
vedran at miletic.net
Fri Jun 3 16:14:33 UTC 2016
Change MESA into Mesa in CL_PLATFORM_VERSION and CL_DEVICE_VERSION. For
both, append git version suffix if available.
Original idea from Giuseppe Bilotta <giuseppe.bilotta at gmail.com>.
---
src/gallium/state_trackers/clover/api/device.cpp | 6 +++++-
src/gallium/state_trackers/clover/api/platform.cpp | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index bc93f91..ce7a3a7 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -300,7 +300,11 @@ 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
+#ifdef MESA_GIT_SHA1
+ " (" MESA_GIT_SHA1 ")"
+#endif
+ ;
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..d80ee18 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -22,6 +22,7 @@
#include "api/util.hpp"
#include "core/platform.hpp"
+#include "git_sha1.h"
using namespace clover;
@@ -57,7 +58,11 @@ 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
+#ifdef MESA_GIT_SHA1
+ " (" MESA_GIT_SHA1 ")"
+#endif
+ ;
break;
case CL_PLATFORM_NAME:
--
2.7.4
More information about the mesa-dev
mailing list