MLIR
15.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... | |
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... | |
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 28 of file TargetAndABI.h.
|
explicit |
bool mlir::spirv::TargetEnv::allows | ( | Capability | ) | const |
Returns true if the given capability is allowed.
Referenced by checkAndUpdateCapabilityRequirements(), checkAndUpdateExtensionRequirements(), checkCapabilityRequirements(), checkExtensionRequirements(), and getVersion().
Returns the first allowed one if any of the given capabilities is allowed.
Returns llvm::None otherwise.
bool mlir::spirv::TargetEnv::allows | ( | Extension | ) | const |
Returns true if the given extension is allowed.
Returns the first allowed one if any of the given extensions is allowed.
Returns llvm::None otherwise.
|
inline |
Definition at line 61 of file TargetAndABI.h.
Referenced by mlir::SPIRVTypeConverter::getOptions().
MLIRContext * spirv::TargetEnv::getContext | ( | ) | const |
Returns the MLIRContext.
Definition at line 89 of file TargetAndABI.cpp.
Referenced by convertScalarType().
uint32_t spirv::TargetEnv::getDeviceID | ( | ) | const |
Returns the device ID.
Definition at line 81 of file TargetAndABI.cpp.
References mlir::spirv::TargetEnvAttr::getDeviceID().
spirv::DeviceType spirv::TargetEnv::getDeviceType | ( | ) | const |
Returns the device type.
Definition at line 77 of file TargetAndABI.cpp.
References mlir::spirv::TargetEnvAttr::getDeviceType().
spirv::ResourceLimitsAttr spirv::TargetEnv::getResourceLimits | ( | ) | const |
Returns the target resource limits.
Definition at line 85 of file TargetAndABI.cpp.
References mlir::spirv::TargetEnvAttr::getResourceLimits().
spirv::Vendor spirv::TargetEnv::getVendorID | ( | ) | const |
Returns the vendor ID.
Definition at line 73 of file TargetAndABI.cpp.
References mlir::spirv::TargetEnvAttr::getVendorID().
spirv::Version spirv::TargetEnv::getVersion | ( | ) | const |
Definition at line 41 of file TargetAndABI.cpp.
References allows(), and mlir::spirv::TargetEnvAttr::getVersion().
Referenced by mlir::SPIRVConversionTarget::get().
|
inline |
Allows implicity converting to the underlying spirv::TargetEnvAttr.
Definition at line 64 of file TargetAndABI.h.
References mlir::spirv::getAddressingModel(), mlir::spirv::getDefaultResourceLimits(), mlir::spirv::getDefaultTargetEnv(), mlir::spirv::getEntryPointABIAttr(), mlir::spirv::getEntryPointABIAttrName(), mlir::spirv::getExecutionModel(), mlir::spirv::getInterfaceVarABIAttr(), mlir::spirv::getInterfaceVarABIAttrName(), mlir::spirv::getMemoryModel(), mlir::spirv::getTargetEnvAttrName(), mlir::spirv::lookupEntryPointABI(), mlir::spirv::lookupLocalWorkGroupSize(), mlir::spirv::lookupTargetEnv(), mlir::spirv::lookupTargetEnvOrDefault(), and mlir::spirv::needsInterfaceVarABIAttrs().