MLIR 22.0.0git
mlir::spirv::VerCapExtAttr Class Reference

An attribute that specifies the SPIR-V (version, capabilities, extensions) triple. More...

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

Inheritance diagram for mlir::spirv::VerCapExtAttr:

Classes

struct  cap_iterator
struct  ext_iterator

Public Types

using ext_range = llvm::iterator_range<ext_iterator>
using cap_range = llvm::iterator_range<cap_iterator>
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

Version getVersion ()
 Returns the version.
ext_range getExtensions ()
 Returns the extensions.
ArrayAttr getExtensionsAttr ()
 Returns the extensions as a string array attribute.
cap_range getCapabilities ()
 Returns the capabilities.
ArrayAttr getCapabilitiesAttr ()
 Returns the capabilities as an integer array attribute.
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 VerCapExtAttr get (Version version, ArrayRef< Capability > capabilities, ArrayRef< Extension > extensions, MLIRContext *context)
 Gets a VerCapExtAttr instance.
static VerCapExtAttr get (IntegerAttr version, ArrayAttr capabilities, ArrayAttr extensions)
static StringRef getKindName ()
 Returns the attribute kind's name (without the 'spirv.' prefix).
static LogicalResult verifyInvariants (function_ref< InFlightDiagnostic()> emitError, IntegerAttr version, ArrayAttr capabilities, ArrayAttr extensions)
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 StringLiteral name = "spirv.ver_cap_ext"

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 SPIR-V (version, capabilities, extensions) triple.

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

◆ cap_range

◆ ext_range

Member Function Documentation

◆ get() [1/2]

spirv::VerCapExtAttr spirv::VerCapExtAttr::get ( IntegerAttr version,
ArrayAttr capabilities,
ArrayAttr extensions )
static

Definition at line 213 of file SPIRVAttributes.cpp.

References ArrayAttr().

◆ get() [2/2]

VerCapExtAttr mlir::spirv::VerCapExtAttr::get ( Version version,
ArrayRef< Capability > capabilities,
ArrayRef< Extension > extensions,
MLIRContext * context )
static

◆ getCapabilities()

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

Returns the capabilities.

Definition at line 252 of file SPIRVAttributes.cpp.

References getCapabilitiesAttr().

Referenced by print().

◆ getCapabilitiesAttr()

ArrayAttr spirv::VerCapExtAttr::getCapabilitiesAttr ( )

Returns the capabilities as an integer array attribute.

Definition at line 257 of file SPIRVAttributes.cpp.

References ArrayAttr(), and mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >::getImpl().

Referenced by getCapabilities().

◆ getExtensions()

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

Returns the extensions.

Definition at line 235 of file SPIRVAttributes.cpp.

References getExtensionsAttr().

◆ getExtensionsAttr()

ArrayAttr spirv::VerCapExtAttr::getExtensionsAttr ( )

Returns the extensions as a string array attribute.

Definition at line 240 of file SPIRVAttributes.cpp.

References ArrayAttr(), and mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer, Traits... >::getImpl().

Referenced by getExtensions(), and print().

◆ getKindName()

StringRef spirv::VerCapExtAttr::getKindName ( )
static

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

Definition at line 221 of file SPIRVAttributes.cpp.

Referenced by print().

◆ getVersion()

spirv::Version spirv::VerCapExtAttr::getVersion ( )

◆ verifyInvariants()

LogicalResult spirv::VerCapExtAttr::verifyInvariants ( function_ref< InFlightDiagnostic()> emitError,
IntegerAttr version,
ArrayAttr capabilities,
ArrayAttr extensions )
static

Definition at line 261 of file SPIRVAttributes.cpp.

References ArrayAttr(), mlir::emitError(), and success().

Member Data Documentation

◆ name

StringLiteral mlir::spirv::VerCapExtAttr::name = "spirv.ver_cap_ext"
staticconstexpr

Definition at line 137 of file SPIRVAttributes.h.


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