MLIR
20.0.0git
|
A wrapper class around a spirv::TargetEnvAttr to provide query methods for allowed version/capabilities/extensions. More...
#include "mlir/Dialect/SPIRV/IR/TargetAndABI.h"
Public Member Functions | |
TargetEnv (TargetEnvAttr targetAttr) | |
Version | getVersion () const |
bool | allows (Capability) const |
Returns true if the given capability is allowed. More... | |
std::optional< Capability > | allows (ArrayRef< Capability >) const |
Returns the first allowed one if any of the given capabilities is allowed. More... | |
bool | allows (Extension) const |
Returns true if the given extension is allowed. More... | |
std::optional< Extension > | allows (ArrayRef< Extension >) const |
Returns the first allowed one if any of the given extensions is allowed. More... | |
Vendor | getVendorID () const |
Returns the vendor ID. More... | |
DeviceType | getDeviceType () const |
Returns the device type. More... | |
uint32_t | getDeviceID () const |
Returns the device ID. More... | |
MLIRContext * | getContext () const |
Returns the MLIRContext. More... | |
ResourceLimitsAttr | getResourceLimits () const |
Returns the target resource limits. More... | |
TargetEnvAttr | getAttr () const |
operator TargetEnvAttr () const | |
Allows implicity converting to the underlying spirv::TargetEnvAttr. More... | |
A wrapper class around a spirv::TargetEnvAttr to provide query methods for allowed version/capabilities/extensions.
Definition at line 29 of file TargetAndABI.h.
|
explicit |
std::optional<Capability> mlir::spirv::TargetEnv::allows | ( | ArrayRef< Capability > | ) | const |
Returns the first allowed one if any of the given capabilities is allowed.
Returns std::nullopt otherwise.
std::optional<Extension> mlir::spirv::TargetEnv::allows | ( | ArrayRef< Extension > | ) | const |
Returns the first allowed one if any of the given extensions is allowed.
Returns std::nullopt otherwise.
bool mlir::spirv::TargetEnv::allows | ( | Capability | ) | const |
Returns true if the given capability is allowed.
Referenced by mlir::SPIRVTypeConverter::allows(), checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), and lowerEntryPointABIAttr().
bool mlir::spirv::TargetEnv::allows | ( | Extension | ) | const |
Returns true if the given extension is allowed.
|
inline |
Definition at line 62 of file TargetAndABI.h.
MLIRContext * spirv::TargetEnv::getContext | ( | ) | const |
Returns the MLIRContext.
Definition at line 91 of file TargetAndABI.cpp.
uint32_t spirv::TargetEnv::getDeviceID | ( | ) | const |
Returns the device ID.
Definition at line 83 of file TargetAndABI.cpp.
spirv::DeviceType spirv::TargetEnv::getDeviceType | ( | ) | const |
Returns the device type.
Definition at line 79 of file TargetAndABI.cpp.
spirv::ResourceLimitsAttr spirv::TargetEnv::getResourceLimits | ( | ) | const |
Returns the target resource limits.
Definition at line 87 of file TargetAndABI.cpp.
spirv::Vendor spirv::TargetEnv::getVendorID | ( | ) | const |
Returns the vendor ID.
Definition at line 75 of file TargetAndABI.cpp.
spirv::Version spirv::TargetEnv::getVersion | ( | ) | const |
Definition at line 43 of file TargetAndABI.cpp.
|
inline |
Allows implicity converting to the underlying spirv::TargetEnvAttr.
Definition at line 65 of file TargetAndABI.h.