Aaron Watry <awa...@gmail.com> writes:

> Useful for testing API, builtin library, and device completeness of
> not-yet-supported versions.
>
> Signed-off-by: Aaron Watry <awa...@gmail.com>
> Cc: Pierre Moreau <pierre.mor...@free.fr>
> Cc: Jan Vesely <jan.ves...@rutgers.edu>
> Cc: Francisco Jerez <curroje...@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"));

Can you make the version_string declaration local to this case block and
mark as const?  With that fixed:

Reviewed-by: Francisco Jerez <curroje...@riseup.net>

> +
> +      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

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to