MLIR  19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlir::spirv::TargetEnvAttr Class Reference

An attribute that specifies the target version, allowed extensions and capabilities, and resource limits. More...

#include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"

+ Inheritance diagram for mlir::spirv::TargetEnvAttr:

Public Types

using Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... >
 Utility declarations for the concrete attribute class. More...
 
- Public Types inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
using Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... >
 Utility declarations for the concrete attribute class. More...
 
using ImplType = StorageT
 
using HasTraitFn = bool(*)(TypeID)
 

Public Member Functions

VerCapExtAttr getTripleAttr () const
 Returns the (version, capabilities, extensions) triple attribute. More...
 
Version getVersion () const
 Returns the target version. More...
 
VerCapExtAttr::ext_range getExtensions ()
 Returns the target extensions. More...
 
ArrayAttr getExtensionsAttr ()
 Returns the target extensions as a string array attribute. More...
 
VerCapExtAttr::cap_range getCapabilities ()
 Returns the target capabilities. More...
 
ArrayAttr getCapabilitiesAttr ()
 Returns the target capabilities as an integer array attribute. More...
 
ClientAPI getClientAPI () const
 Returns the client API. 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...
 
ResourceLimitsAttr getResourceLimits () const
 Returns the target resource limits. More...
 
- Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
ImplTypegetImpl () const
 Utility for easy access to the storage instance. More...
 

Static Public Member Functions

static TargetEnvAttr get (VerCapExtAttr triple, ResourceLimitsAttr limits, ClientAPI clientAPI=ClientAPI::Unknown, Vendor vendorID=Vendor::Unknown, DeviceType deviceType=DeviceType::Unknown, uint32_t deviceId=kUnknownDeviceID)
 Gets a TargetEnvAttr instance. More...
 
static StringRef getKindName ()
 Returns the attribute kind's name (without the 'spirv.' prefix). More...
 
- Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
static TypeID getTypeID ()
 Return a unique identifier for the concrete type. More...
 
template<typename T >
static bool classof (T val)
 Provide an implementation of 'classof' that compares the type id of the provided value with that of the concrete type. More...
 
static detail::InterfaceMap getInterfaceMap ()
 Returns an interface map for the interfaces registered to this storage user. More...
 
static HasTraitFn getHasTraitFn ()
 Returns the function that returns true if the given Trait ID matches the IDs of any of the traits defined by the storage user. More...
 
static auto getWalkImmediateSubElementsFn ()
 Returns a function that walks immediate sub elements of a given instance of the storage user. More...
 
static auto getReplaceImmediateSubElementsFn ()
 Returns a function that replaces immediate sub elements of a given instance of the storage user. More...
 
template<typename... IfaceModels>
static void attachInterface (MLIRContext &context)
 Attach the given models as implementations of the corresponding interfaces for the concrete storage user class. More...
 
template<typename... Args>
static ConcreteT get (MLIRContext *ctx, Args &&...args)
 Get or create a new ConcreteT instance within the ctx. More...
 
template<typename... Args>
static ConcreteT getChecked (const Location &loc, Args &&...args)
 Get or create a new ConcreteT instance within the ctx, defined at the given, potentially unknown, location. More...
 
template<typename... Args>
static ConcreteT getChecked (function_ref< InFlightDiagnostic()> emitErrorFn, MLIRContext *ctx, Args... args)
 Get or create a new ConcreteT instance within the ctx. More...
 
static ConcreteT getFromOpaquePointer (const void *ptr)
 Get an instance of the concrete type from a void pointer. More...
 

Static Public Attributes

static constexpr uint32_t kUnknownDeviceID = 0x7FFFFFFF
 ID for unknown devices. More...
 
static constexpr StringLiteral name = "spirv.target_env"
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
template<typename... Args>
LogicalResult mutate (Args &&...args)
 Mutate the current storage instance. More...
 
- Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >
template<typename... Args>
static LogicalResult verify (Args... args)
 Default implementation that just returns success. More...
 

Detailed Description

An attribute that specifies the target version, allowed extensions and capabilities, and resource limits.

These information describes a SPIR-V target environment.

Definition at line 141 of file SPIRVAttributes.h.

Member Typedef Documentation

◆ Base

using mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::Base = StorageUserBase<ConcreteT, BaseT, StorageT, UniquerT, Traits...>

Utility declarations for the concrete attribute class.

Definition at line 101 of file StorageUniquerSupport.h.

Member Function Documentation

◆ get()

spirv::TargetEnvAttr spirv::TargetEnvAttr::get ( spirv::VerCapExtAttr  triple,
ResourceLimitsAttr  limits,
ClientAPI  clientAPI = ClientAPI::Unknown,
Vendor  vendorID = Vendor::Unknown,
DeviceType  deviceType = DeviceType::Unknown,
uint32_t  deviceId = kUnknownDeviceID 
)
static

Gets a TargetEnvAttr instance.

Definition at line 290 of file SPIRVAttributes.cpp.

References mlir::get().

Referenced by mlir::spirv::getDefaultTargetEnv(), and parseTargetEnvAttr().

◆ getCapabilities()

spirv::VerCapExtAttr::cap_range spirv::TargetEnvAttr::getCapabilities ( )

◆ getCapabilitiesAttr()

ArrayAttr spirv::TargetEnvAttr::getCapabilitiesAttr ( )

Returns the target capabilities as an integer array attribute.

Definition at line 321 of file SPIRVAttributes.cpp.

◆ getClientAPI()

spirv::ClientAPI spirv::TargetEnvAttr::getClientAPI ( ) const

Returns the client API.

Definition at line 325 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getDeviceID()

uint32_t spirv::TargetEnvAttr::getDeviceID ( ) const

Returns the device ID.

Definition at line 337 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getDeviceType()

spirv::DeviceType spirv::TargetEnvAttr::getDeviceType ( ) const

Returns the device type.

Definition at line 333 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getExtensions()

spirv::VerCapExtAttr::ext_range spirv::TargetEnvAttr::getExtensions ( )

Returns the target extensions.

Definition at line 309 of file SPIRVAttributes.cpp.

Referenced by mlir::spirv::TargetEnv::TargetEnv().

◆ getExtensionsAttr()

ArrayAttr spirv::TargetEnvAttr::getExtensionsAttr ( )

Returns the target extensions as a string array attribute.

Definition at line 313 of file SPIRVAttributes.cpp.

◆ getKindName()

StringRef spirv::TargetEnvAttr::getKindName ( )
static

Returns the attribute kind's name (without the 'spirv.' prefix).

Definition at line 299 of file SPIRVAttributes.cpp.

Referenced by print().

◆ getResourceLimits()

spirv::ResourceLimitsAttr spirv::TargetEnvAttr::getResourceLimits ( ) const

Returns the target resource limits.

Definition at line 341 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getTripleAttr()

spirv::VerCapExtAttr spirv::TargetEnvAttr::getTripleAttr ( ) const

Returns the (version, capabilities, extensions) triple attribute.

Definition at line 301 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getVendorID()

spirv::Vendor spirv::TargetEnvAttr::getVendorID ( ) const

Returns the vendor ID.

Definition at line 329 of file SPIRVAttributes.cpp.

References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().

Referenced by print().

◆ getVersion()

spirv::Version spirv::TargetEnvAttr::getVersion ( ) const

Returns the target version.

Definition at line 305 of file SPIRVAttributes.cpp.

Referenced by mlir::spirv::TargetEnv::TargetEnv().

Member Data Documentation

◆ kUnknownDeviceID

constexpr uint32_t mlir::spirv::TargetEnvAttr::kUnknownDeviceID = 0x7FFFFFFF
staticconstexpr

ID for unknown devices.

Definition at line 146 of file SPIRVAttributes.h.

Referenced by mlir::spirv::getDefaultTargetEnv(), parseTargetEnvAttr(), and print().

◆ name

constexpr StringLiteral mlir::spirv::TargetEnvAttr::name = "spirv.target_env"
staticconstexpr

Definition at line 191 of file SPIRVAttributes.h.


The documentation for this class was generated from the following files: