MLIR  15.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::SPIRVTypeConverter::Options Struct Reference

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

+ Collaboration diagram for mlir::SPIRVTypeConverter::Options:

Public Member Functions

 Options ()
 

Public Attributes

bool emulateNon32BitScalarTypes {true}
 Whether to emulate non-32-bit scalar types with 32-bit scalar types if no native support. More...
 
bool use64bitIndex {false}
 Use 64-bit integers to convert index types. More...
 
unsigned boolNumBits {8}
 The number of bits to store a boolean value. More...
 

Detailed Description

Definition at line 35 of file SPIRVConversion.h.

Constructor & Destructor Documentation

◆ Options()

mlir::SPIRVTypeConverter::Options::Options ( )
inline

Member Data Documentation

◆ boolNumBits

unsigned mlir::SPIRVTypeConverter::Options::boolNumBits {8}

The number of bits to store a boolean value.

It is eight bits by default.

Definition at line 57 of file SPIRVConversion.h.

Referenced by convertBoolMemrefType().

◆ emulateNon32BitScalarTypes

bool mlir::SPIRVTypeConverter::Options::emulateNon32BitScalarTypes {true}

Whether to emulate non-32-bit scalar types with 32-bit scalar types if no native support.

Non-32-bit scalar types require special hardware support that may not exist on all GPUs. This is reflected in SPIR-V as that non-32-bit scalar types require special capabilities or extensions. This option controls whether to use 32-bit types to emulate, if a scalar type of a certain bitwidth is not supported in the target environment. This requires the runtime to also feed in data with a matched bitwidth and layout for interface types. The runtime can do that by inspecting the SPIR-V module.

If the original scalar type has less than 32-bit, a multiple of its values will be packed into one 32-bit value to be memory efficient.

Definition at line 50 of file SPIRVConversion.h.

Referenced by convertScalarType(), and mlir::arith::populateArithmeticToSPIRVPatterns().

◆ use64bitIndex

bool mlir::SPIRVTypeConverter::Options::use64bitIndex {false}

Use 64-bit integers to convert index types.

Definition at line 53 of file SPIRVConversion.h.

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


The documentation for this struct was generated from the following file: