Browse Source

clover: Add an helper for checking if an IR is supported

Reviewed-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
tags/19.1-branchpoint
Pierre Moreau 7 years ago
parent
commit
505ec3a530

+ 6
- 0
src/gallium/state_trackers/clover/core/device.cpp View File

@@ -272,3 +272,9 @@ device::device_clc_version() const {
debug_get_option("CLOVER_DEVICE_CLC_VERSION_OVERRIDE", "1.1");
return device_clc_version;
}

bool
device::supports_ir(enum pipe_shader_ir ir) const {
return pipe->get_shader_param(pipe, PIPE_SHADER_COMPUTE,
PIPE_SHADER_CAP_SUPPORTED_IRS) & (1 << ir);
}

+ 1
- 0
src/gallium/state_trackers/clover/core/device.hpp View File

@@ -82,6 +82,7 @@ namespace clover {
enum pipe_shader_ir ir_format() const;
std::string ir_target() const;
enum pipe_endian endianness() const;
bool supports_ir(enum pipe_shader_ir ir) const;

friend class command_queue;
friend class root_resource;

Loading…
Cancel
Save