MLIR  15.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...
 
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...
 
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 28 of file TargetAndABI.h.

Constructor & Destructor Documentation

◆ TargetEnv()

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

Member Function Documentation

◆ allows() [1/4]

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

◆ allows() [2/4]

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

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

Returns llvm::None otherwise.

◆ allows() [3/4]

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

Returns true if the given extension is allowed.

◆ allows() [4/4]

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

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

Returns llvm::None otherwise.

◆ getAttr()

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

Definition at line 61 of file TargetAndABI.h.

Referenced by mlir::SPIRVTypeConverter::getOptions().

◆ getContext()

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

Returns the MLIRContext.

Definition at line 89 of file TargetAndABI.cpp.

Referenced by convertScalarType().

◆ getDeviceID()

uint32_t spirv::TargetEnv::getDeviceID ( ) const

Returns the device ID.

Definition at line 81 of file TargetAndABI.cpp.

References mlir::spirv::TargetEnvAttr::getDeviceID().

◆ getDeviceType()

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

Returns the device type.

Definition at line 77 of file TargetAndABI.cpp.

References mlir::spirv::TargetEnvAttr::getDeviceType().

◆ getResourceLimits()

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

Returns the target resource limits.

Definition at line 85 of file TargetAndABI.cpp.

References mlir::spirv::TargetEnvAttr::getResourceLimits().

◆ getVendorID()

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

Returns the vendor ID.

Definition at line 73 of file TargetAndABI.cpp.

References mlir::spirv::TargetEnvAttr::getVendorID().

◆ getVersion()

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

◆ operator TargetEnvAttr()

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

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