MLIR 22.0.0git
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
 Utility declarations for the concrete attribute class.
Public Types inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
using Base
 Utility declarations for the concrete attribute class.
using ImplType
using HasTraitFn

Public Member Functions

VerCapExtAttr getTripleAttr () const
 Returns the (version, capabilities, extensions) triple attribute.
Version getVersion () const
 Returns the target version.
VerCapExtAttr::ext_range getExtensions ()
 Returns the target extensions.
ArrayAttr getExtensionsAttr ()
 Returns the target extensions as a string array attribute.
VerCapExtAttr::cap_range getCapabilities ()
 Returns the target capabilities.
ArrayAttr getCapabilitiesAttr ()
 Returns the target capabilities as an integer array attribute.
ClientAPI getClientAPI () const
 Returns the client API.
Vendor getVendorID () const
 Returns the vendor ID.
DeviceType getDeviceType () const
 Returns the device type.
uint32_t getDeviceID () const
 Returns the device ID.
ResourceLimitsAttr getResourceLimits () const
 Returns the target resource limits.
Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
ImplTypegetImpl () const
 Utility for easy access to the storage instance.

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.
static StringRef getKindName ()
 Returns the attribute kind's name (without the 'spirv.' prefix).
Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
static TypeID getTypeID ()
 Return a unique identifier for the concrete type.
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.
static detail::InterfaceMap getInterfaceMap ()
 Returns an interface map for the interfaces registered to this storage user.
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.
static auto getWalkImmediateSubElementsFn ()
 Returns a function that walks immediate sub elements of a given instance of the storage user.
static auto getReplaceImmediateSubElementsFn ()
 Returns a function that replaces immediate sub elements of a given instance of the storage user.
static void attachInterface (MLIRContext &context)
 Attach the given models as implementations of the corresponding interfaces for the concrete storage user class.
static ConcreteType get (MLIRContext *ctx, Args &&...args)
 Get or create a new ConcreteT instance within the ctx.
static ConcreteType getChecked (const Location &loc, Args &&...args)
 Get or create a new ConcreteT instance within the ctx, defined at the given, potentially unknown, location.
static ConcreteType getChecked (function_ref< InFlightDiagnostic()> emitErrorFn, MLIRContext *ctx, Args... args)
 Get or create a new ConcreteT instance within the ctx.
static ConcreteType getFromOpaquePointer (const void *ptr)
 Get an instance of the concrete type from a void pointer.

Static Public Attributes

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

Additional Inherited Members

Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
LogicalResult mutate (Args &&...args)
 Mutate the current storage instance.
Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >
static LogicalResult verifyInvariants (Args... args)
 Default implementation that just returns success.

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 143 of file SPIRVAttributes.h.

Member Typedef Documentation

◆ Base

using mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits >::Base

Utility declarations for the concrete attribute class.

Definition at line 100 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.

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.

References ArrayAttr(), and getTripleAttr().

◆ getClientAPI()

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

◆ getDeviceID()

uint32_t spirv::TargetEnvAttr::getDeviceID ( ) const

◆ getDeviceType()

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

◆ getExtensions()

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

Returns the target extensions.

Definition at line 309 of file SPIRVAttributes.cpp.

References getTripleAttr().

◆ getExtensionsAttr()

ArrayAttr spirv::TargetEnvAttr::getExtensionsAttr ( )

Returns the target extensions as a string array attribute.

Definition at line 313 of file SPIRVAttributes.cpp.

References ArrayAttr(), and getTripleAttr().

◆ 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

◆ getTripleAttr()

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

◆ getVendorID()

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

◆ getVersion()

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

Returns the target version.

Definition at line 305 of file SPIRVAttributes.cpp.

References getTripleAttr().

Member Data Documentation

◆ kUnknownDeviceID

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

ID for unknown devices.

Definition at line 148 of file SPIRVAttributes.h.

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

◆ name

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

Definition at line 193 of file SPIRVAttributes.h.


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