MLIR  19.0.0git
Public Member Functions | List of all members
mlir::spirv::TargetEnv Class Reference

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...
 
std::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...
 
std::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...
 
MLIRContextgetContext () 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...
 

Detailed Description

A wrapper class around a spirv::TargetEnvAttr to provide query methods for allowed version/capabilities/extensions.

Definition at line 29 of file TargetAndABI.h.

Constructor & Destructor Documentation

◆ TargetEnv()

spirv::TargetEnv::TargetEnv ( spirv::TargetEnvAttr  targetAttr)
explicit

Member Function Documentation

◆ allows() [1/4]

std::optional<Capability> mlir::spirv::TargetEnv::allows ( ArrayRef< Capability >  ) const

Returns the first allowed one if any of the given capabilities is allowed.

Returns std::nullopt otherwise.

◆ allows() [2/4]

std::optional<Extension> mlir::spirv::TargetEnv::allows ( ArrayRef< Extension >  ) const

Returns the first allowed one if any of the given extensions is allowed.

Returns std::nullopt otherwise.

◆ allows() [3/4]

bool mlir::spirv::TargetEnv::allows ( Capability  ) const

Returns true if the given capability is allowed.

Referenced by mlir::SPIRVTypeConverter::allows(), and lowerEntryPointABIAttr().

◆ allows() [4/4]

bool mlir::spirv::TargetEnv::allows ( Extension  ) const

Returns true if the given extension is allowed.

◆ getAttr()

TargetEnvAttr mlir::spirv::TargetEnv::getAttr ( ) const
inline

Definition at line 62 of file TargetAndABI.h.

◆ getContext()

MLIRContext * spirv::TargetEnv::getContext ( ) const

Returns the MLIRContext.

Definition at line 91 of file TargetAndABI.cpp.

◆ getDeviceID()

uint32_t spirv::TargetEnv::getDeviceID ( ) const

Returns the device ID.

Definition at line 83 of file TargetAndABI.cpp.

◆ getDeviceType()

spirv::DeviceType spirv::TargetEnv::getDeviceType ( ) const

Returns the device type.

Definition at line 79 of file TargetAndABI.cpp.

◆ getResourceLimits()

spirv::ResourceLimitsAttr spirv::TargetEnv::getResourceLimits ( ) const

Returns the target resource limits.

Definition at line 87 of file TargetAndABI.cpp.

◆ getVendorID()

spirv::Vendor spirv::TargetEnv::getVendorID ( ) const

Returns the vendor ID.

Definition at line 75 of file TargetAndABI.cpp.

◆ getVersion()

spirv::Version spirv::TargetEnv::getVersion ( ) const

Definition at line 43 of file TargetAndABI.cpp.

◆ operator TargetEnvAttr()

mlir::spirv::TargetEnv::operator TargetEnvAttr ( ) const
inline

Allows implicity converting to the underlying spirv::TargetEnvAttr.

Definition at line 65 of file TargetAndABI.h.


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