summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Watry <[email protected]>2017-08-09 22:02:30 -0500
committerAaron Watry <[email protected]>2018-03-05 20:09:46 -0600
commit95ae6c0355379127706e516d177f7f6ee8296d48 (patch)
treedaf8f74b5f41c4b2f76d61acd92421edc299fc96 /src
parent106020712fa3250caafb4d42d590d366c8bd8ac9 (diff)
clover: Allow overriding platform/device version numbers
Useful for testing API, builtin library, and device completeness of not-yet-supported versions. Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Pierre Moreau <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v3) Reviewed-by: Emil Velikov <[email protected]> Cc: Jan Vesely <[email protected]> v4: Remove redundant std::string wrapper around debug_get_option calls v3: mark CL version overrides as static and const v2: Make version_string in platform const in case
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/api/platform.cpp10
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp9
2 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/clover/api/platform.cpp b/src/gallium/state_trackers/clover/api/platform.cpp
index ed861633116..3b96b03fde8 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -23,6 +23,7 @@
#include "api/util.hpp"
#include "core/platform.hpp"
#include "git_sha1.h"
+#include "util/u_debug.h"
using namespace clover;
@@ -57,14 +58,17 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
buf.as_string() = "FULL_PROFILE";
break;
- case CL_PLATFORM_VERSION:
- buf.as_string() = "OpenCL 1.1 Mesa " PACKAGE_VERSION
+ case CL_PLATFORM_VERSION: {
+ static const std::string version_string =
+ debug_get_option("CLOVER_PLATFORM_VERSION_OVERRIDE", "1.1");
+
+ buf.as_string() = "OpenCL " + version_string + " Mesa " PACKAGE_VERSION
#ifdef MESA_GIT_SHA1
" (" MESA_GIT_SHA1 ")"
#endif
;
break;
-
+ }
case CL_PLATFORM_NAME:
buf.as_string() = "Clover";
break;
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 71cf4bf60af..0d911e37514 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -25,6 +25,7 @@
#include "core/platform.hpp"
#include "pipe/p_screen.h"
#include "pipe/p_state.h"
+#include "util/u_debug.h"
using namespace clover;
@@ -268,10 +269,14 @@ device::endianness() const {
std::string
device::device_version() const {
- return "1.1";
+ static const std::string device_version =
+ debug_get_option("CLOVER_DEVICE_VERSION_OVERRIDE", "1.1");
+ return device_version;
}
std::string
device::device_clc_version() const {
- return "1.1";
+ static const std::string device_clc_version =
+ debug_get_option("CLOVER_DEVICE_CLC_VERSION_OVERRIDE", "1.1");
+ return device_clc_version;
}