MLIR  16.0.0git
Public Attributes | List of all members
mlir::SPIRVConversionOptions Struct Reference

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

+ Collaboration diagram for mlir::SPIRVConversionOptions:

Public Attributes

unsigned boolNumBits {8}
 The number of bits to store a boolean value. More...
 
bool emulateLT32BitScalarTypes {true}
 Whether to emulate narrower scalar types with 32-bit scalar types if not supported by the target. More...
 
bool use64bitIndex {false}
 Use 64-bit integers to convert index types. More...
 
bool enableFastMathMode {false}
 Whether to enable fast math mode during conversion. More...
 

Detailed Description

Definition at line 29 of file SPIRVConversion.h.

Member Data Documentation

◆ boolNumBits

unsigned mlir::SPIRVConversionOptions::boolNumBits {8}

The number of bits to store a boolean value.

Definition at line 31 of file SPIRVConversion.h.

◆ emulateLT32BitScalarTypes

bool mlir::SPIRVConversionOptions::emulateLT32BitScalarTypes {true}

Whether to emulate narrower scalar types with 32-bit scalar types if not supported by the target.

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 < 32-bits-wide scalars, 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 47 of file SPIRVConversion.h.

◆ enableFastMathMode

bool mlir::SPIRVConversionOptions::enableFastMathMode {false}

Whether to enable fast math mode during conversion.

If true, various patterns would assume no NaN/infinity numbers as inputs, and thus there will be no special guards emitted to check and handle such cases.

Definition at line 55 of file SPIRVConversion.h.

◆ use64bitIndex

bool mlir::SPIRVConversionOptions::use64bitIndex {false}

Use 64-bit integers to convert index types.

Definition at line 50 of file SPIRVConversion.h.

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


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