[Mesa-dev] [PATCH v2 02/22] clover: Add additional functions to query supported IRs
Francisco Jerez
currojerez at riseup.net
Tue Jan 23 22:03:29 UTC 2018
Pierre Moreau <pierre.morrow at free.fr> writes:
> Signed-off-by: Pierre Moreau <pierre.morrow at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180123/f9e24d12/attachment.sig>
More information about the mesa-dev
mailing list