[Mesa-dev] [PATCH 1/2] clover: Allow overriding platform/device version numbers
Pierre Moreau
pierre.morrow at free.fr
Thu Mar 1 21:55:03 UTC 2018
Reviewed-by: Pierre Moreau <pierre.morrow at free.fr>
On 2018-03-01 — 13:44, Aaron Watry wrote:
> Useful for testing API, builtin library, and device completeness of
> not-yet-supported versions.
>
> Signed-off-by: Aaron Watry <awatry at gmail.com>
> Cc: Pierre Moreau <pierre.morrow at free.fr>
> Cc: Jan Vesely <jan.vesely at rutgers.edu>
> Cc: Francisco Jerez <currojerez at riseup.net>
> ---
> src/gallium/state_trackers/clover/api/platform.cpp | 7 ++++++-
> src/gallium/state_trackers/clover/core/device.cpp | 5 +++--
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/api/platform.cpp b/src/gallium/state_trackers/clover/api/platform.cpp
> index ed86163311..8cb2718973 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;
>
> @@ -51,6 +52,7 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
> property_buffer buf { r_buf, size, r_size };
>
> obj(d_platform);
> + std::string version_string;
>
> switch (param) {
> case CL_PLATFORM_PROFILE:
> @@ -58,7 +60,10 @@ 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
> + version_string = std::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
> diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
> index 71cf4bf60a..245d728886 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,10 @@ device::endianness() const {
>
> std::string
> device::device_version() const {
> - return "1.1";
> + return std::string(debug_get_option("CLOVER_DEVICE_VERSION_OVERRIDE", "1.1"));
> }
>
> std::string
> device::device_clc_version() const {
> - return "1.1";
> + return std::string(debug_get_option("CLOVER_DEVICE_CLC_VERSION_OVERRIDE", "1.1"));
> }
> --
> 2.14.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180301/4b953d57/attachment.sig>
More information about the mesa-dev
mailing list