Pierre Moreau <pierre.mor...@free.fr> writes:

> Signed-off-by: Pierre Moreau <pierre.mor...@free.fr>
> ---
>  src/gallium/state_trackers/clover/core/device.cpp | 11 +++++++++++
>  src/gallium/state_trackers/clover/core/device.hpp |  3 +++
>  2 files changed, 14 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/core/device.cpp 
> b/src/gallium/state_trackers/clover/core/device.cpp
> index 9dd7eed3f1..7eaa0ca2cb 100644
> --- a/src/gallium/state_trackers/clover/core/device.cpp
> +++ b/src/gallium/state_trackers/clover/core/device.cpp
> @@ -247,6 +247,12 @@ device::ir_format() const {
>        pipe, PIPE_SHADER_COMPUTE, PIPE_SHADER_CAP_PREFERRED_IR);
>  }
>  
> +cl_uint
> +device::supported_irs() const {
> +   return (enum pipe_shader_ir) pipe->get_shader_param(
> +      pipe, PIPE_SHADER_COMPUTE, PIPE_SHADER_CAP_SUPPORTED_IRS);
> +}
> +

I don't think we need this as a public method of clover::device, the
bitmask can be a local variable definition within supports_ir below.

>  std::string
>  device::ir_target() const {
>     std::vector<char> target = get_compute_param<char>(
> @@ -268,3 +274,8 @@ std::string
>  device::device_clc_version() const {
>      return "1.1";
>  }
> +
> +bool
> +device::supports_ir(cl_uint ir) const {
> +   return supported_irs() & (1 << ir);
> +}
> diff --git a/src/gallium/state_trackers/clover/core/device.hpp 
> b/src/gallium/state_trackers/clover/core/device.hpp
> index 85cd031676..eed644e919 100644
> --- a/src/gallium/state_trackers/clover/core/device.hpp
> +++ b/src/gallium/state_trackers/clover/core/device.hpp
> @@ -80,9 +80,12 @@ namespace clover {
>        std::string device_version() const;
>        std::string device_clc_version() const;
>        enum pipe_shader_ir ir_format() const;
> +      cl_uint supported_irs() const;
>        std::string ir_target() const;
>        enum pipe_endian endianness() const;
>  
> +      bool supports_ir(cl_uint ir) const;

The argument of this method is a pipe_shader_ir enumerant, we should
declare it as such.

> +
>        friend class command_queue;
>        friend class root_resource;
>        friend class hard_event;
> -- 
> 2.16.0

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