MLIR  15.0.0git
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:
+ Collaboration diagram for mlir::spirv::TargetEnvAttr:

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...
 
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...
 

Static Public Member Functions

static TargetEnvAttr get (VerCapExtAttr triple, Vendor vendorID, DeviceType deviceType, uint32_t deviceId, DictionaryAttr limits)
 Gets a TargetEnvAttr instance. More...
 
static StringRef getKindName ()
 Returns the attribute kind's name (without the 'spv.' prefix). More...
 
static LogicalResult verify (function_ref< InFlightDiagnostic()> emitError, VerCapExtAttr triple, Vendor vendorID, DeviceType deviceType, uint32_t deviceID, DictionaryAttr limits)
 
- 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...
 
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...
 

Additional Inherited Members

- 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)
 
- 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...
 
ImplTypegetImpl () const
 Utility for easy access to the 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 130 of file SPIRVAttributes.h.

Member Function Documentation

◆ get()

spirv::TargetEnvAttr spirv::TargetEnvAttr::get ( spirv::VerCapExtAttr  triple,
Vendor  vendorID,
DeviceType  deviceType,
uint32_t  deviceId,
DictionaryAttr  limits 
)
static

◆ 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 323 of file SPIRVAttributes.cpp.

◆ 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 311 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 315 of file SPIRVAttributes.cpp.

◆ getKindName()

StringRef spirv::TargetEnvAttr::getKindName ( )
static

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

Definition at line 301 of file SPIRVAttributes.cpp.

Referenced by parseTargetEnvAttr(), and print().

◆ getResourceLimits()

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

◆ getTripleAttr()

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

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

Definition at line 303 of file SPIRVAttributes.cpp.

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

Referenced by print().

◆ getVendorID()

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

◆ getVersion()

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

◆ verify()

LogicalResult spirv::TargetEnvAttr::verify ( function_ref< InFlightDiagnostic()>  emitError,
VerCapExtAttr  triple,
Vendor  vendorID,
DeviceType  deviceType,
uint32_t  deviceID,
DictionaryAttr  limits 
)
static

Definition at line 344 of file SPIRVAttributes.cpp.

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

Member Data Documentation

◆ kUnknownDeviceID

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

ID for unknown devices.

Definition at line 135 of file SPIRVAttributes.h.

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


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