MLIR 22.0.0git
mlir::SPIRVTypeConverter Class Reference

Type conversion from builtin types to SPIR-V types for shader interface. More...

#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"

Inheritance diagram for mlir::SPIRVTypeConverter:

Public Member Functions

 SPIRVTypeConverter (spirv::TargetEnvAttr targetAttr, const SPIRVConversionOptions &options={})
Type getIndexType () const
 Gets the SPIR-V correspondence for the standard index type.
unsigned getIndexTypeBitwidth () const
 Gets the bitwidth of the index type when converted to SPIR-V.
const spirv::TargetEnvgetTargetEnv () const
const SPIRVConversionOptionsgetOptions () const
 Returns the options controlling the SPIR-V type converter.
bool allows (spirv::Capability capability) const
 Checks if the SPIR-V capability inquired is supported.

Detailed Description

Type conversion from builtin types to SPIR-V types for shader interface.

For memref types, this converter additionally performs type wrapping to satisfy shader interface requirements: shader interface types must be pointers to structs.

Definition at line 74 of file SPIRVConversion.h.

Constructor & Destructor Documentation

◆ SPIRVTypeConverter()

SPIRVTypeConverter::SPIRVTypeConverter ( spirv::TargetEnvAttr targetAttr,
const SPIRVConversionOptions & options = {} )
explicit

Definition at line 1541 of file SPIRVConversion.cpp.

References getIndexType().

Member Function Documentation

◆ allows()

bool SPIRVTypeConverter::allows ( spirv::Capability capability) const

Checks if the SPIR-V capability inquired is supported.

Definition at line 1610 of file SPIRVConversion.cpp.

Referenced by mlir::spirv::getElementPtr().

◆ getIndexType()

Type SPIRVTypeConverter::getIndexType ( ) const

Gets the SPIR-V correspondence for the standard index type.

Definition at line 1602 of file SPIRVConversion.cpp.

References getContext().

Referenced by mlir::spirv::getOpenCLElementPtr(), mlir::spirv::getVulkanElementPtr(), and SPIRVTypeConverter().

◆ getIndexTypeBitwidth()

unsigned mlir::SPIRVTypeConverter::getIndexTypeBitwidth ( ) const
inline

Gets the bitwidth of the index type when converted to SPIR-V.

Definition at line 83 of file SPIRVConversion.h.

◆ getOptions()

const SPIRVConversionOptions & mlir::SPIRVTypeConverter::getOptions ( ) const
inline

Returns the options controlling the SPIR-V type converter.

Definition at line 90 of file SPIRVConversion.h.

◆ getTargetEnv()

const spirv::TargetEnv & mlir::SPIRVTypeConverter::getTargetEnv ( ) const
inline

Definition at line 87 of file SPIRVConversion.h.


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